you may use logging module. Or at least : print <<sys.stderr, "%s doesn't exist!" % logfile