Filed under Uncategorized

Redirecting Python Logging Output for Test

A simple way to capture logging output to the screen (STDOUT) in python is monkey patch logging methods. def monkey_print(*args): print args setattr(logging, ‘info’, monkey_print) When you are done debugging delete the above code and you’re back on track. It’s not pretty, but it gets the job done fast. Advertisements

The Vexing zlib Problem with Snow Leopard

Traceback (most recent call last): File “/usr/local/bin/virtualenv”, line 5, in from pkg_resources import load_entry_point zipimport.ZipImportError: can’t decompress data; zlib not available Seen this when working with python on OS X 10.6 (Snow Leopard)? This seemingly came out of nowhere when I wanted to set up a virtualenv on a macbook pro that hadn’t been used … Continue reading

The Scandal of Chevy Volt-Gate!

The Scandal of Chevy Volt-Gate!

Ho-hum, it’s another attack on alternative vehicles for being too expensive. Now it’s the Volt.  Then it was the Prius; the issue being that the premium for the hybrid electric vehicle did not make economic sense with gasoline below $5/gallon.  What such analyses always neglect is that a car is not a purely rational purchase … Continue reading

Sidebar: Python, MySQL, Snow Leopard Installation

I just had to install MySQL on my Snow Leopard (OS X 10.6) Mac interfacing to it with Python using MySQLdb. This installation is not necessarily straightforward, and its difficulty depends on how mindful or lucky you are of keeping track of whether you’re on a 32 or 64 bit architecture.  So here’s my recipe for getting it to … Continue reading