code: def shout(msg, f=sys.stderr):
      '''Log to file (usually stderr), with progname: <log>'''
      print >> f, "{0}: {1}".format(_PROG, msg)
      f.flush(f shout(msg, f=sys.stderr):
      '''Log to file (usually stderr), with progname: <log>'''
      print >> f, "{0}: {1}".format(_PROG, msg)
      f.flush()
docs: Log to file (usually stderr), with progname: <log>