I ran the code below in jupyter notebook and I was able to create an exe file, but when I ran it, my PC was forced to return to the logout screen. (Using mac) The size of the exe file is 8.2MB.
Tkinter.ipynb
--add-binary='/System/Library/Frameworks/Tcl.framework/Tcl':'tcl'
If you remove the above, it will not drop, but you will get the error "tcl data directory not found".
If anyone is familiar with it, could you please tell me the solution?
Tkinter.ipynb
import tkinter as tk
class Application(tk.Frame):
def __init__(self, master):
super().__init__(master)
self.pack()
master.geometry("500x200")
master.title("Test software")
self.setGUI()
def setGUI(self):
self.txt1 = tk.Entry(width=50)
self.txt1.place(x=15, y=50)
self.txt2 = tk.Entry(width=50)
self.txt2.place(x=15, y=100)
self.btn = tk.Button(text="Run", command = self.btn_click, width=30)
self.btn.place(x=125, y=150)
def btn_click(self):
if self.txt1.get() == "":
self.txt2.delete(0, tk.END)
self.txt2.insert(0, "")
else:
self.txt2.delete(0, tk.END)
self.txt2.insert(0, self.txt1.get())
if __name__ == "__main__":
win = tk.Tk()
app = Application(master = win)
app.mainloop()
pyinstaller --onefile --add-binary='/System/Library/Frameworks/Tcl.framework/Tcl':'tcl' Tkinter.ipynb