How to tell if I'm being run from a shell or a module

Jeff jeffober at gmail.com
Thu Feb 14 12:27:09 EST 2008


Conventionally, you use:

if __name__ == '__main__':
  # do something as a script



More information about the Python-list mailing list