0
創建可執行文件我已經創建了一個Python應用程序,並使其可執行使用cx_Freeze
CMD控制檯。啓動由cx_Freeze在Python
當腳本未轉換到它用於拍攝從cmd
的輸入(在視窗)的可執行文件。但是,當它被轉換成exe時,它不會提示我輸入。
我用下面的代碼爲setup.py
我的腳本。
includefiles = ["checkPointValueSheets.py"] # include any files here that you wish
includes = []
excludes = []
packages = ["lxml"]
exe = Executable(
# what to build
script = "app.py", # the name of your main python script goes here
initScript = None,
base = None, # if creating a GUI instead of a console app, type "Win32GUI"
targetName = "aflPredictionAutomation.exe", # this is the name of the executable file
copyDependentFiles = True,
compress = True,
appendScriptToExe = True,
appendScriptToLibrary = True,
icon = None # if you want to use an icon file, specify the file name here
)
setup(
# the actual setup & the definition of other misc. info
name = "app", # program name
version = "0.1",
description = 'A general enhancement utility',
author = "K Perkins",
author_email = "",
options = {"build_exe": {"excludes":excludes,"packages":packages,
"include_files":includefiles}},
executables = [exe]
)
請幫我啓動CMD控制檯,我打我的EXE輸入。
運行可執行文件,當我得到這個錯誤..
感謝
我評論過的線條和編輯我的問題太代碼。其實錯誤屏幕快照是因爲它不能'輸入名稱_elementpath' 它來自於我的源代碼中的行 'import lxm.html' 。你能幫我嗎?腳本在cmd上運行良好。 – Anand
這是一個完全不同的問題:你必須告訴cx_freeze你使用的模塊。你可以看看這篇文章[http://stackoverflow.com/questions/16639429/cx-freeze-module-dependency](http://stackoverflow.com/questions/16639429/cx-freeze - 模塊依賴關係) –
該頁面沒有任何內容 – Anand