1
2:mod:`__main__` --- Top-level script environment
3================================================
4
5.. module:: __main__
6   :synopsis: The environment where the top-level script is run.
7
8
9This module represents the (otherwise anonymous) scope in which the
10interpreter's main program executes --- commands read either from standard
11input, from a script file, or from an interactive prompt.  It is this
12environment in which the idiomatic "conditional script" stanza causes a script
13to run::
14
15   if __name__ == "__main__":
16       main()
17
18