I am trying to learn the Tkinter module. My code runs without any problems (no errors pop up) but the output/display window doesn't show up.
I am using Visual Studio Code to use Python Tkinter.
Code:
# Import Tkinter
from tkinter import *
from tkinter import filedialog
# Make the Window
gui=Tk()
gui.geometry("600x600")
# Define the functions of the buttons
def save_file():
print(" ")
def clear():
print("")
def load_file():
print(" ")
# Define the buttons on the GUI
savefile=Button(gui, text="Save File", command=save_file)
savefile.place(x=10,y=10)
clear=Button(gui, text="Clear Document", command=clear)
clear.place(x=40,y=10)
loadfile=Button(gui, text="Load File", command=load_file)
loadfile.place(x=80,y=10)
gui.mainloop
Its obvious: Your code misses some ()
:
gui.mainloop()
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.