簡體   English   中英

cx_freeze:編譯的tkinter應用未啟動

[英]cx_freeze : compiled tkinter app is not lauching

這是我第一次使用cx_freeze,我確實需要幫助,我一直在尋找無處不在,但找不到答案。

我在編譯過程中沒有任何錯誤,但是可執行文件什么都不做。 有人可以解釋一下為什么嗎?

這是我的項目結構:

應用

  • setup.py
  • application.py(從cell.py導入2個函數的Tkinter應用)
  • logo.jpg
  • favicon.ico
  • 負責任的
  • 模塊:
    • cell.py(所有工作都在此文件中完成)

我不知道在安裝程序中將cell.py文件包含在哪里,因為它現在在文件Modules中。 而且我不確定Tkinter應該包含還是排除。

這是setup.py文件:

import sys
from cx_Freeze import setup, Executable


executables = [
        Executable("application.py")
]

buildOptions = dict(
        compressed = True,
        includes = ["sys","re","PIL","ttk","xlrd","xlutils","datetime","string","Tkinter"],
        include_files = ["responsible.xls","favicon.ico","logo.jpg"],
        excludes = []
        path = sys.path + ["modules"]
)

setup(
    name = "test",
    version = "1.1.1.0",
    description = "test",
    options = dict(build_exe = buildOptions),
    executables = executables
 )

您可以使用include_files選項添加要包括的目錄。 因此,代碼的這一部分應如下所示:

buildOptions = dict(
        compressed = True,
        includes = ["sys","re","PIL","ttk","xlrd","xlutils","datetime","string","Tkinter"],
        include_files = ["responsible.xls","favicon.ico","logo.jpg", "modules"],
        excludes = []
        path = sys.path + ["modules"]
)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM