28.5. __main__ — 顶层脚本环境

This module represents the (otherwise anonymous) scope in which the interpreter’s main program executes — commands read either from standard input, from a script file, or from an interactive prompt. It is this environment in which the idiomatic “conditional script” stanza causes a script to run:

if __name__ == "__main__":
    main()
							

上一话题

28.4. future_builtins — Python 3 builtins

下一话题

28.6. warnings — 警告控制

本页