账号密码登录框是固定大小的,此案例使用的是grid
源码如下:
from tkinter import *
root = Tk()
bt1 = Label(root,text=‘账号:’).grid(row=0,sticky=W)
bt1 = Entry(root).grid(row=0,column=1,sticky=E)
bt2 = Label(root,text=‘密码:’) .grid(row=1,sticky=W)
bt2 = Entry(root).grid(row=1,column=1,sticky=E)
bt3 = Button(root,text=‘登录’).grid(row=2,column=1,sticky=W)
bt4 = Button(root,text=‘注册’).grid(row=2,column=0,sticky=W)
root.mainloop()