PageRenderTime 3ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/Doc/library/__main__.rst

http://unladen-swallow.googlecode.com/
ReStructuredText | 17 lines | 11 code | 6 blank | 0 comment | 0 complexity | c6b933a38eb9b80fec04dda2561a217a MD5 | raw file
 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