繁体   English   中英

Python Tkinter 模块未显示 GUI Output

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM