Commit 9f0519be by BellCodeEditor

auto save

parent 0651e310
提交的用户名是:124234
\ No newline at end of file
提交的用户名是:阿斯蒂芬和
\ No newline at end of file
import tkinter
#创建一个窗口界面3"00
root = tkinter.Tk()
root.title("注册")
root.geometry("400x300+500+300")
root.mainloop()
import tkinter
root = tkinter.Tk()
root.title("注册")
root.geometry("400x300+500+300")
# 输入框账号 5"46
e1 = tkinter.Entry(root,show=None,font=("宋体",14),bg="light grey",width=18)
e1.place(x=140,y=80)
#密码输入框,密文形式
e2 = tkinter.Entry(root,show="#",font=("宋体",14),width=18)
e2.place(x=140,y=140)
e3 = tkinter.Entry(root,show="$*",font=("宋体",14),width=18)
e3.place(x=140,y=200)
#在图形界面上设定标签
lab = tkinter.Label(root,text='您好!请填写注册信息',font=('宋体',15),
fg='black',width=40,height=2,bg='green')
lab.place(x=0,y=0)
lab1 = tkinter.Label(root,text='用 户 名:',font=('宋体',12),fg='red')
lab1.place(x=60,y=80)
lab2 = tkinter.Label(root,text='密 码:',font=('宋体',12),fg='red')
lab2.place(x=60,y=140)
lab3 = tkinter.Label(root,text='确认密码:',font=('宋体',12),fg='red')
lab3.place(x=60,y=200)
root.mainloop()
import tkinter
# 定义函数 3'13
def a():
name = e1.get()
print('提交的用户名是:',name)
root = tkinter.Tk()
root.title("注册")
root.geometry("400x300+500+300")
# 拉伸 0'38 True可以拉伸,False不能拉伸
root.resizable(width=False,height=False)
e1 = tkinter.Entry(root,show=None,font=("宋体",14),bg="light grey",width=18)
e1.place(x=140,y=80)
#密码输入框,密文形式
e2 = tkinter.Entry(root,show="*",font=("宋体",14),width=18)
e2.place(x=140,y=140)
e2 = tkinter.Entry(root,show="*",font=("宋体",14),width=18)
e2.place(x=140,y=200)
#在图形界面上设定标签
lab = tkinter.Label(root,text='您好!请填写注册信息',font=('宋体',15),
fg='black',width=40,height=2,bg='green')
lab.place(x=0,y=0)
lab1 = tkinter.Label(root,text='用户名',font=('宋体',12),fg='red')
lab1.place(x=60,y=80)
lab2 = tkinter.Label(root,text='密 码',font=('宋体',12),fg='red')
lab2.place(x=60,y=140)
lab3 = tkinter.Label(root,text='确认密码',font=('宋体',12),fg='red')
lab3.place(x=60,y=200)
# 按钮:fg 字体颜色 1'33
button1 = tkinter.Button(root,text="提交",bg='lightgreen',width=15,command=a)
button1.place(x=150,y=250)
root.mainloop()
import tkinter
# 定义函数 3'13
def a():
name = e1.get()
with open(r'C:\Users\user\Documents\level3-lesson17-diy1\sdf.txt','w',encoding='utf-8') as xxx:
# t='提交的用户名是:'+name
xxx.write('提交的用户名是:'+name)
print('提交的用户名是:',name)
root = tkinter.Tk()
root.title("注册")
root.geometry("400x300+500+300")
# 拉伸 0'38 True可以拉伸,False不能拉伸
root.resizable(width=False,height=False)
e1 = tkinter.Entry(root,show=None,font=("宋体",14),bg="light grey",width=18)
e1.place(x=140,y=80)
#密码输入框,密文形式
e2 = tkinter.Entry(root,show="*",font=("宋体",14),width=18)
e2.place(x=140,y=140)
e2 = tkinter.Entry(root,show="*",font=("宋体",14),width=18)
e2.place(x=140,y=200)
#在图形界面上设定标签
lab = tkinter.Label(root,text='您好!请填写注册信息',font=('宋体',15),
fg='black',width=40,height=2,bg='green')
lab.place(x=0,y=0)
lab1 = tkinter.Label(root,text='用户名',font=('宋体',12),fg='red')
lab1.place(x=60,y=80)
lab2 = tkinter.Label(root,text='密 码',font=('宋体',12),fg='red')
lab2.place(x=60,y=140)
lab3 = tkinter.Label(root,text='确认密码',font=('宋体',12),fg='red')
lab3.place(x=60,y=200)
# 按钮:fg 字体颜色 1'33
button1 = tkinter.Button(root,text="提交",bg='lightgreen',width=15,command=a)
button1.place(x=150,y=250)
root.mainloop()
提交的用户名是:好好学习
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment