idle and __name__

Jeffrey Kunce kuncej at mail.conservation.state.mo.us
Tue May 18 09:46:35 EDT 1999


I commonly use the python idiom:

if __name__=="__main__":
    runMainRoutine()

If I use "Run Module" in Idle, this doesn't
work because it is not the main module.

Is there some variable or flag I can test to see
if I'm running a main module from Idle?

  --Jeff






More information about the Python-list mailing list