Python tkiner designs a simple login interface, and the effect is shown in the following figure. This is a basic tutorial for tkiner, and I hope it will be helpful to you.

from tkinter import *
from tkinter import messagebox
def func():
name = entry_name.get()
password=entry_password.get()
print(name)
print(password)
# 创建窗口
root=Tk()
# 设置窗口标题
root.title('请登录')
# 调整窗口大小+位置
root.geometry("500x200+400+200")
# 添加标签控件并定位
label1 = Label(root,text="账号:",font=("宋体",25),fg="red")
label2=Label(root,text="密码:",font=("宋体",25),fg="red")
# 定位
label1.grid(row=0,column=0)
label2.grid(row=1,column=0)
# 添加输入框
entry_name = Entry(root,font=("宋体",25),fg="red")
entry_name.grid(row=0,column=1)
entry_password=Entry(root,font=("宋体",25),fg="red")
entry_password['show']='*'
entry_password.grid(row=1,column=1)
# 添加点击按钮
button = Button(root,text="确认",font=("宋体",25),fg="blue",command=func)
button.grid(row=2,column=1)
# 显示窗口
root.mainloop()