Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with cx_Freeze
#4
It try to load tix module,so i would try Pyinstaller instead of troubleshoot on this.

Quick test.
# tk_test.py
import tkinter as tk

class App(tk.Tk):
    def __init__(self):
        super().__init__()
        self.var = tk.StringVar()
        self.var.trace("w", self.show_message)
        self.entry = tk.Entry(self, textvariable=self.var)
        self.btn = tk.Button(self, text="Clear",
                             command=lambda: self.var.set(""))
        self.label = tk.Label(self)
        self.entry.pack()
        self.btn.pack()
        self.label.pack()

    def show_message(self, *args):
        value = self.var.get()
        text = f"Hello, {value}!" if value else ""
        self.label.config(text=text)

if __name__ == "__main__":
    app = App()
    app.mainloop()
Using Python 3.9.1 and Pyinstaller 4.2(pip install pyinstaller).
C:\code\tk_exe
λ python -V
Python 3.9.1

C:\code\tk_exe
λ pyinstaller --version
4.2
Icon here call it idea.ico

Usage pyinstaller --onefile --windowed --icon=idea.ico tk_test.py
C:\code\tk_exe
λ pyinstaller --onefile --windowed --icon=idea.ico tk_test.py
66 INFO: PyInstaller: 4.2
67 INFO: Python: 3.9.1
68 INFO: Platform: Windows-10-10.0.19041-SP0
71 INFO: wrote C:\code\tk_exe\tk_test.spec
.....
9558 INFO: Appending archive to EXE C:\code\tk_exe\dist\tk_test.exe
9571 INFO: Building EXE from EXE-00.toc completed successfully.
In dist folder tk_test.exe.
[Image: CDwPRF.png]
Reply


Messages In This Thread
Help with cx_Freeze - by mederic39 - Jan-30-2021, 08:58 PM
RE: Help with cx_Freeze - by snippsat - Jan-30-2021, 09:43 PM
RE: Help with cx_Freeze - by mederic39 - Jan-31-2021, 07:11 AM
RE: Help with cx_Freeze - by snippsat - Jan-31-2021, 12:05 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Problem with cx_freeze app only on one pc floatingshed 0 1,813 Mar-19-2021, 05:19 PM
Last Post: floatingshed
  cx_freeze frozen executive introduces WinError 10049 KipCarter 3 3,196 Jan-14-2020, 02:34 PM
Last Post: KipCarter
  Python 3.6 Alternatives to Cx_Freeze KipCarter 5 5,071 Jan-14-2020, 11:51 AM
Last Post: KipCarter
  cx_freeze exe does not work? Skycoder 4 6,383 Jan-13-2020, 06:50 PM
Last Post: KipCarter
  How to get cx_Freeze to make folders mad_accountant 0 3,115 Nov-24-2019, 02:22 PM
Last Post: mad_accountant
  cx_freeze setup.py error: No module __SNMP-FRAMEWORK-MIB nacho 8 9,050 Jul-26-2019, 09:33 PM
Last Post: njmatt415
  Error in build using cx_freeze with psychopy based animation olivyac 0 2,927 Sep-19-2017, 07:55 PM
Last Post: olivyac

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020