I’m slowly converting most of my lab to Python. One of the great things is how fantastic the documentation for things like matplotlib is. On the other hand, some of the Python documentation itself is ridiculous.

Somebody wanted to set up some simple logging. He wanted to have a
couple of different logging levels, he wanted to be able to switch
between them from the command line, and he wanted to be able to spit
messages to stdout as well. The official docs
have a trivial example that’s very nice, but a bit too trivial and
then several examples that were way too much for someone who’s in his
first week of Python. He also really wanted to be able to specify
numbers on the command line, and didn’t want to remember what the
logging module’s internal constants (e.g. logging.CRITICAL == 50)
are. Instead, he wanted to be able to give words or small, easy to
remember numbers. Here’s the simple example we came up with: