[英]cx_Freeze exe file opens and then closes
我的代碼轉換器代碼在這里:
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")] )
我還想問一下這是什么意思:
if __name__.endswith('__main__'):
關於問題的第一部分:請參閱此答案以獲取有效的安裝腳本,以使用cx_Freeze 5.1.1凍結依賴tkinter的應用程序(另請參閱我對問題的評論)
關於問題的第二部分
這是什么意思:
if __name__.endswith('__main__'):
請參見如果__name__ ==“ __main__”怎么辦?
您可能已從本期或類似版本中獲得了正在使用的修改版本。 無論如何,此行及其修改可能與主應用程序有關,但在安裝腳本中不是必需的,應從那里刪除。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.