Issue #5262: Improved fix.
[python.git] / Doc / library / __main__.rst
bloba1d3c24bea5a3c524f3a5f441fe30c7e703f5500
2 :mod:`__main__` --- Top-level script environment
3 ================================================
5 .. module:: __main__
6    :synopsis: The environment where the top-level script is run.
9 This module represents the (otherwise anonymous) scope in which the
10 interpreter's main program executes --- commands read either from standard
11 input, from a script file, or from an interactive prompt.  It is this
12 environment in which the idiomatic "conditional script" stanza causes a script
13 to run::
15    if __name__ == "__main__":
16        main()