Imported or executed?
Stephan Schulz
schulz at sunbroy2.informatik.tu-muenchen.de
Wed Feb 16 14:26:49 EST 2005
More information about the Python-list mailing list
Wed Feb 16 14:26:49 EST 2005
- Previous message (by thread): Imported or executed?
- Next message (by thread): Can __new__ prevent __init__ from being called?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
In article <mailman.2715.1108581429.22381.python-list at python.org>, Fredrik Lundh wrote: >Stephan Schulz wrote: > >> Is there a (portable, standard) way for the program/module to find out >> if it is imported or executed stand-alone? > >if a module is executed, it's name is set to "__main__". see: [...] It works. Thanks! Bye, Stephan -- -------------------------- It can be done! --------------------------------- Please email me as schulz at informatik.tu-muenchen.de (Stephan Schulz) ----------------------------------------------------------------------------
- Previous message (by thread): Imported or executed?
- Next message (by thread): Can __new__ prevent __init__ from being called?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list