首页 > 其他 > 详细

__name__和__main的含义

时间:2016-01-23 10:24:44      阅读:218      评论:0      收藏:0      [点我收藏+]
if __name__ == "__main__":
    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:

#此模块表示解释器的主程序执行的(否则为匿名)的范围,该命令读取标准输入,从脚本文件,或从交互式提示读取。正是这种环境,地道的“有条件的脚本”节使脚本运行:

 

__name__和__main的含义

原文:http://www.cnblogs.com/kamil/p/5152831.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!