Commit 5b687cac by BellCodeEditor

save project

parent 5618cba3
Showing with 1 additions and 22 deletions
import tkinter import tkinter
import json
from tkinter import messagebox
with open('user.txt','r',encoding='utf-8') as f:
info=f.read()
r=json.loads(info)
def login_to_reg(): # 登录界面转注册界面 def login_to_reg(): # 登录界面转注册界面
app_login.root.destroy() app_login.root.destroy()
...@@ -16,23 +11,7 @@ def reg_to_login(): # 注册界面转登录界面 ...@@ -16,23 +11,7 @@ def reg_to_login(): # 注册界面转登录界面
app_login=My_login() app_login=My_login()
app_login.show() app_login.show()
def register(): # 注册验证 def register(): # 注册验证
name1,password1,password2=app_reg.get_input() pass
if name1=='' or password1=='' or password2=='':
messagebox.showwarning('警告','请输入正确的数据')
elif name1 in user:
messagebox.showwarning('警告','用户名重复')
elif password1!=password2:
messagebox.showwarning('警告','两次密码输入不一样')
else:
users[name1]=password1
c=json.dumps(user)
with open('user.txt','w',encoding='utf-8') as f:
f.write(c)
messagebox.showinfo('成功','注册成功')
app_reg.root.destroy()
global app_login
app_login=My_login()
app_login.show()
def login(): # 登录验证 def login(): # 登录验证
pass pass
......
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