and use it liberally to help me understand the flow of the program. Most of those programs set _debugging at the top of the file, and I edit the file to turn it on or off (usually once to turn it off, after I'm done debugging). A few, however, have a command line switch -v == --verbose that sets it during program startup.
As cghtkh points out, you can also print to a file.
Better, probably, to use a logger to do whatever you need (it can write files and also/instead print to the screen on either sys.stdout or sys.stderr ). Python comes with a quite reasonable one, though you do have to play with it a bit at first if you haven't ever used one before. http://docs.python.org/library/logging.html Loggers give you quite a bit of control over logging output both while writing code: You get to set the severity level that triggers logging; and while running: You get to set the severity cut off level for this run for this logger. These cutoff levels can be set individually for each output hook, so for instance, you can set the severity level for console output to FATAL the severity level for the 'time tick logger' to INFO and the severity level for the development logger to DEBUG during development and NOTSET when running in the real world. In your code, some logging statements would be errors, some info, some debug, etc.