繁体   English   中英

cx_Freeze exe文件打开,然后关闭

[英]cx_Freeze exe file opens and then closes

  1. 我的代码转换器代码在这里:

     import os os.environ['TCL_LIBRARY'] = "C:\\\\Program Files (x86)\\\\Python35-32\\\\tcl\\\\tcl8.6" os.environ['TK_LIBRARY'] = "C:\\\\Program Files (x86)\\\\Python35-32\\\\tcl\\\\tk8.6" from cx_Freeze import setup, Executable if __name__.endswith('__main__'): setup(name = "Dodge The Blocks", version = "2.0", description = 'A fun little game for when your bored', executables = [Executable(r"C:\\Users\\Harshal\\Desktop\\GameWIP.py")] ) 
  2. 我还想问一下这是什么意思:

     if __name__.endswith('__main__'): 
  1. 关于问题的第一部分:请参阅此答案以获取有效的安装脚本,以使用cx_Freeze 5.1.1冻结依赖tkinter的应用程序(另请参阅我对问题的评论)

  2. 关于问题的第二部分

    这是什么意思:

     if __name__.endswith('__main__'): 

    请参见如果__name__ ==“ __main__”怎么办?

    您可能已从本期或类似版本中获得了正在使用的修改版本。 无论如何,此行及其修改可能与主应用程序有关,但在安装脚本中不是必需的,应从那里删除。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM