This commit is contained in:
dengrb1 2023-04-25 23:07:39 +08:00 committed by GitHub
parent 16dbdf2072
commit 15a25eefb5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

33
reg.pyw
View File

@ -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()