2
저는 Python을 처음 사용합니다. cx_freeze로 실행 파일을 만들려고하는데 파일을 만든 후에 exe를 시작할 수 없습니다. setup.pycx Freeze 실행 파일이 없습니다. import import _tkinter #이 코드가 실패하면 python이 tk 용으로 구성되지 않을 수도 있습니다.
import sys
import os
os.environ['TCL_LIBRARY'] = "C:\\Users\\Valeri\\AppData\\Local\\Programs\\Python\\Python36-32\\tcl\\tcl8.6"
os.environ['TK_LIBRARY'] = "C:\\Users\\Valeri\\AppData\\Local\\Programs\\Python\\Python36-32\\tcl\\tk8.6"
from cx_Freeze import setup, Executable
# replaces commandline arg 'build'
sys.argv.append("build")
# change the filename to your program file --->
filename = "SolutionGenerator.py"
base = None
if sys.platform == "win32":
base = "Win32GUI"
setup(
name = "Circle",
version = "1.0",
description = "cx_Freeze Tkinter script",
executables = [Executable(filename, base=base)])
3.6.0
코드 pytone 내가 사용하고
: 나는 다음과 같은 오류를 얻고있다
import sys import os os.environ['TCL_LIBRARY'] = "C:\\Users\\Valeri\\AppData\\Local\\Programs\\Python\\Python36-32\\tcl\\tcl8.6" os.environ['TK_LIBRARY'] = "C:\\Users\\Valeri\\AppData\\Local\\Programs\\Python\\Python36-32\\tcl\\tk8.6" from cx_Freeze import setup, Executable "SolutionGenerator.py" base = None if sys.platform == "win32":
base = "Win32GUI" setup(
name = "Circle",
version = "1.0",
description = "cx_Freeze Tkinter script",
executables = [Executable(filename, base=base)])
죄송합니다. 나는 초기 게시물에서 실수를했습니다. 코드는 실제로 : Tkinter를 가져 오기에서 * 수입 임의 메시지 = Tkinter를 가져 오기 메시지 박스에서 [ '! рекриейтни там нещо'] # 응답 = (메시지 [random.randint (0, 렌 (메시지) - 1)]) 최고 = TK에() top.title ("임의의 헛소리 창") top.geometry ("200x180") 데프 helloCallBack() : MSG = messagebox.showinfo (! "샷"(메시지 (상단, 텍스트 = "지금 쐈어!", command = helloCallBack) B.config (높이 = 3, 너비 = 0, len (메시지) - 1)])) B = 15) B.place (x = 50, y = 50) top.mainloop() – Val
이 솔루션을 사용해 보셨습니까? - https://stackoverflow.com/a/42357202/7046074 –