Profiling Python Flask Web Apps with Pyinstrument

In the previous post, I talked about using cProfile (via Werkzeug Application Profiler Middleware) to profile parts of code or routes in Flask web apps. In this one, we’ll explore another tool called pyinstrument that does statistical profiling instead of deterministic profiling, that can be easily used with Flask or any other web framework like […]

Pytest Print or Dump Variables to Console for Debugging

Trying to print(var) in your pytest tests and wondering why you cannot see the output in your terminal’s standard output? This is because by default pytest captures all output sent to stdout and stderr, i.e., it intercepts the data going into the low-level file descriptors 1 and 2. This is a good idea because pytest […]

Vim Unset or Toggle a Boolean Option

There are a bunch of ways to toggle a boolean option in Vim. An example of a boolean option is number that shows line numbers when set or expandtab that inserts spaces instead of the tab character (\t). Setting them is simple: How can we unset or toggle them quickly? Well if you just want […]