tkinter - cx_freeze won't create a correct .exe for python 3.1.1 -
i use python 3.1.1, , have been trying compile program wrote earlier today, think code short enough post below.
from tkinter import * class application(frame): """ gui application creates story based on user input. """ def __init__(self, master): """ initialize frame. """ super(application, self).__init__(master) self.grid() self.label1() self.label2() def label1(self): label(self, text = "shop keeper 1.1", font = ("fixedsys", 72)).grid(row = 0, column = 0, sticky = w) def label2(self): label(self, text = "welcome shop keeper 1.1!" ).grid(row = 1, column = 0, sticky = w) # create label , text entry plural noun label(self, text = "block name:" ).grid(row = 2, column = 0, sticky = w) self.blokid = entry(self) self.blokid.grid(row = 2, column = 1, sticky = w) # create label , text entry verb label(self, text = "amount:" ).grid(row = 3, column = 0, sticky = w) self.amound = entry(self) self.amound.grid(row = 3, column = 1, sticky = w) label(self, text = "name:" ).grid(row = 4, column = 0, sticky = w) self.nama = entry(self) self.nama.grid(row = 4, column = 1, sticky = w) label(self, text = "desired price:" ).grid(row = 5, column = 0, sticky = w) self.desprice = entry(self) self.desprice.grid(row = 5, column = 1, sticky = w) # create submit button button(self, text = "submit order", command = self.submit ).grid(row = 6, column = 1, sticky = w) self.submit = text(self, width = 75, height = 10, wrap = word) self.submit.grid(row = 7, column = 0, columnspan = 4) def submit(self): """ fill text box new story based on user input. """ # values gui blockid = self.blokid.get() amount = self.amound.get() name = self.nama.get() price = self.desprice.get() emess = name emess += " ordered " emess += amount emess += " units of " emess += blockid emess += " @ price of " emess += price emess += " each." emess += "\n" # display story self.submit.insert(0.0, emess) # main root = tk() root.title("shop keeper 1.0") app = application(root) root.mainloop() i've been trying compile cx_freeze few hours, no luck. creates folder, when click on .exe opens , closes fast. after clicking fast multiple times, found missing module tkinter, , after searching forums here i've come conclusion missing module. can't fix it, however! i've tried add tcl8.5 , tk8.5 folders suggested, doesn't seem fix it. i've tried can, create question last resort. folder created has files:
_socket.pyd _tkinter.pyd library.zip mad_lib.exe python31.dll select.pyd tcl85.dll tk85.dll unicodedata.pyd please help!
i tried following , worked fine me.
using activestate python 3.2.2.3 (http://www.activestate.com/activepython/downloads)
i went http://cx-freeze.sourceforge.net/ , downloaded & installed msi python 3.2 (i'm using 64 bit).
i saved program c:\scripts\shopkeeper.py
next ran this:
c:\python32\scripts\cxfreeze c:\scripts\shopkeeper.py --target-dir c:\cxfreezetest then ran c:\cxfreezetest\shopkeeper.exe , worked fine.

Comments
Post a Comment