base
및 icon
그들이 그것을 전달되지 않는 것 코드에 cx_Freeze.Executable
의 options
이다. cx_Freeze.setup(options = ...
에서
executables = cx_Freeze.Executable("frame.py", base=base, icon='ds.ico')
는 먼저 사전 키 "build_exe"
값의 일부로서 사전 키 "packages"
을 추가하고 있지만 갑자기 당신이있어 : 그들은 너무입니다 ()
단지 "frame.py"
처럼 될 필요는 사용 키 대신 include_files
을 추가하려고하면 값의 일부인 사전에 여전히 "packages"
~ "build_exe"
키가 추가됩니다. 설명하기가 어렵습니다. 어쨌든.
import cx_Freeze, sys
base = None
if sys.platform == 'Win32':
base = "Win32GUI"
executables = cx_Freeze.Executable("frame.py", base=base, icon='ds.ico')
cx_Freeze.setup(
name="cYou",
options = {"build_exe": {"packages":["tkinter"], "include_files":["ds.ico"]}},
version= "0.01",
description = "dasdasd",
executables = executables
)
아래
내가 Tkinter를 사용할 것입니다 : 같은
전체 코드가 보일 것입니다. 나는이 스크립트 옆에 내 tkinter 스크립트 something.py
을 넣는다. 그럼 난 그저 something
에 응답합니다.
from cx_Freeze import setup, Executable
import sys, os
fileName = input("What's the name of the py file to be converted to .exe?\n")
sys.argv.append('build')
os.environ['TCL_LIBRARY'] = r'C:\Users\username\AppData\Local\Programs\Python\Python36\tcl\tcl8.6'
os.environ['TK_LIBRARY'] = r'C:\Users\username\AppData\Local\Programs\Python\Python36\tcl\tk8.6'
base = None
if (sys.platform == "win32"):
base = "Win32GUI" # Tells the build script to hide the console.
elif (sys.platform == "win64"):
base = "Win64GUI" # Tells the build script to hide the console.
setup(
name='KutsalAklinNerde?',
version='0.1', #Further information about its version
description='Parse stuff', #It's description
executables=[Executable(fileName + ".py", base=base)])
출처
2017-12-05 23:37:14
Nae
항상 오류 메시지를 텍스트로 표시하고 스크린 샷을 삽입하지 마십시오. 아이콘 파일 등을 포함하기 위해 일부 수정이 필요할 수 있습니다. 스크린 샷의 텍스트를 복사하여 답안이나 Google 검색에서 텍스트를 사용할 수 없습니다. – furas