Imported or executed?
Stephan Schulz
schulz at sunbroy2.informatik.tu-muenchen.de
Wed Feb 16 14:26:49 EST 2005
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)
----------------------------------------------------------------------------
More information about the Python-list
mailing list