2.1 __main__ -- 顶层脚本的运行环境 Top-level script environment

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:

这个模块描述了(否则就是匿名的)解释器主程序运行命令的作用域 - 这些命令 包括读取自标准输入的, 脚本文件的, 或者交互模式提示符的. 一般我们会用以下的``条件脚本''块来使一个脚本运行, 这个环境就是 __main__ .

if __name__ == "__main__":
    main()