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

Jeff jeffober at gmail.com
Thu Feb 14 18:27:09 CET 2008


Conventionally, you use:

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



More information about the Python-list mailing list