#基本的四要素:
from tkinter import * #导入tkinter模块
root=Tk() #创建window窗口对象
root.title('计算器示例_2111424王伊雯') #设置窗口标题
root.geometry('200x300+280+280')
root.config(bg='#ccff00')
#布局
from tkinter import *
root = Tk()
root.title('登录')
root['width']=200;root['height']=80
Label(root,text = '用户名',width=6).place(x=1,y=1)
Entry(root,width=20).place(x=45,y=1)
Label(root,text = '密码',width=6).place(x=1,y=20)
Entry(root,width=20,show='*').place(x=45,y=20)
Button(root,text = '登录',width=8).place(x=40,y=40)
Button(root,text = '取消',width=8).place(x=110,y=40)
root.mainloop()
运行结果: