Entering edit mode
3.4 years ago
caro-ca
▴
20
I am practicing classes with GUI and tkinter on Visual Studio for Mac. My piece of code is:
#!/usr/bin/env python3
import tkinter as tk
class AddGUI (tk.Frame):
def __init__ (self):
tk.Frame.__init__(self)
self.master.title('adding one')
self.define_widgets()
self.grid()
my_gui = AddGUI()
my_gui.mainloop()
When I run this script as python3 Tutoriol_Gui.py
the script doesn't retrieve anything until I interrupt it meaning that the library is there but I don't know what to do to speed up the process or if something is missing.
$ python3 Tutoriol_Gui.py ^X^C Traceback (most recent call last): File "Tutoriol_Gui.py", line 15, in <module>
my_gui.mainloop() File "/Users/cacabezas/miniconda3/lib/python3.7/tkinter/__init__.py", line 1283, in mainloop
self.tk.mainloop(n) KeyboardInterrupt (base)
Additionally, if I run:
#!/usr/bin/env python3
import tkinter as tk
root = tk.Tk()
root.mainloop()
I got retrieved a window
I hope you could help me out. I already checked different websites but couldn't find anything useful. Thank you in advance.