[英]Python Tkinter module not showing GUI Output
我正在嘗試學習 Tkinter 模塊。 我的代碼運行沒有任何問題(沒有錯誤彈出),但輸出/顯示 window 沒有出現。
我正在使用 Visual Studio Code 來使用 Python Tkinter。
代碼:
# 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
很明顯:您的代碼遺漏了一些()
:
gui.mainloop()
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.