import logging import sys log = logging.getLogger(__name__) out_hdlr = logging.StreamHandler(sys.stdout) out_hdlr.setFormatter(logging.Formatter(‘%(asctime)s %(message)s’)) out_hdlr.setLevel(logging.INFO) log.addHandler(out_hdlr) log.setLevel(logging.INFO) Then you can do: log.debug(“NO”) […]

Need a simple server? From the command line, you can simply run: python -m SimpleHTTPServer Need a different port? No […]

Recently I found this simple one liner which can save your time & can be efficient to check if number […]

When a plain pip install fails at the package download step, try one of the PyPI mirrors. One can tell […]

To add CodeIntel for Python in Sublime Text 2 from your virtual environment create folder .codeinter in your project root […]

I’m getting asked time to time, why I use Flask (what is Flask at all?) and what I do like […]

I’m not a big user of twitter, but when I tweet, I want to do it fast. I use this […]

You can pipe to “python -mjson.tool” and have it to format the json. curl “” | python -mjson.tool

Need a quick web server to server up some pages and javascript. Trying out different javascript front ends? One of […]

Namespaces are one honking great idea — let’s do more of those! – Tim Peters, PEP20 We all know (or […]

What if pypi fails or it’s going slow: $ pip install –use-mirrors package $ pip install -i package Funny […]