1 >>> from tkinter import *; 2 >>> root=Tk() 3 >>> myLabel=Label(root,text="Hello world!"); 4 >>> myLabel.grid() 5 >>> root.mainloop()
先使用from tkinter import *;导入tkinter模块,输入上面的代码,出项GUI界面如上;