reg
This commit is contained in:
parent
16dbdf2072
commit
15a25eefb5
33
reg.pyw
33
reg.pyw
@ -1,25 +1,30 @@
|
|||||||
from tkinter import *
|
from tkinter import *
|
||||||
from tkinter import messagebox, ttk
|
from tkinter import ttk
|
||||||
|
|
||||||
|
|
||||||
root = Tk()
|
root = Tk()
|
||||||
|
root.title("注册程序")
|
||||||
|
|
||||||
e1 = ttk.Entry(root)
|
username_label = ttk.Label(root, text="用户名:")
|
||||||
e2 = ttk.Entry(root)
|
username_label.pack()
|
||||||
l1 = ttk.Label(root, text='用户名:')
|
|
||||||
l2 = ttk.Label(root, text='密码:')
|
|
||||||
|
|
||||||
|
username_entry = ttk.Entry(root)
|
||||||
|
username_entry.pack()
|
||||||
|
|
||||||
def ok():
|
password_label = ttk.Label(root, text="密码:")
|
||||||
input_username = e1.get()
|
password_label.pack()
|
||||||
input_password = e2.get()
|
|
||||||
if input_username and input_password != None:
|
password_entry = ttk.Entry(root, show="*")
|
||||||
with open('password.md','w'):
|
password_entry.pack()
|
||||||
pass
|
|
||||||
pass
|
def register():
|
||||||
else:
|
username = username_entry.get()
|
||||||
|
password = password_entry.get()
|
||||||
|
with open("c:\\username.md", "w") as f:
|
||||||
|
f.write(f"{username},{password}")
|
||||||
pass
|
pass
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
register_button = ttk.Button(root, text="注册", command=register)
|
||||||
|
register_button.pack()
|
||||||
|
|
||||||
root.mainloop()
|
root.mainloop()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user