diff --git a/ToDolist1.py b/ToDolist1.py new file mode 100644 index 0000000..a219f07 --- /dev/null +++ b/ToDolist1.py @@ -0,0 +1,44 @@ +import tkinter + +def reg(): + name=e1.get() + password = e2.get() + enpassword = e3.get() + print(name+'\n'+password+'\n'+enpassword) + +# 建立窗口对象 +root = tkinter.Tk() +root.geometry("400x320+0+0") # 设置大小 +root.title('注册') # 设置标题 + +# 输入框Entry 用户名 密码 确认密码 +e1 = tkinter.Entry(root, show=None, bg='lightblue', font=('宋体', 14), width=18) +e1.place(x=140, y=80) + +e2 = tkinter.Entry(root, show="*", bg='lightblue', font=('宋体', 14), width=18) +e2.place(x=140, y=130) + +e3 = tkinter.Entry(root, show="*", bg='lightblue', font=('宋体', 14), width=18) +e3.place(x=140, y=180) + +# 文字标签 Label 设置字体颜色 fg='颜色' red + +lab1 = tkinter.Label(root, text='请填写注册信息',width = 50,height = 3,font = 30,bg = 'green',fg='red') +lab1.place(x=0, y=0) + +lab2 = tkinter.Label(root, text='用户名:',fg='red') +lab2.place(x=60, y=80) + +lab3 = tkinter.Label(root, text='密码:',fg='red') +lab3.place(x=60, y=130) + +lab4 = tkinter.Label(root, text='确认密码:',fg='red') +lab4.place(x=60, y=180) +#按钮 +button = tkinter.Button(root, text='提交',width = 10,height = 1,font = 30,bg = 'green',fg='red' ,command = reg) +button.place(x=150, y=250) + + + +# 进入消息循环 +root.mainloop()