Commit 1b2b45b5 by BellCodeEditor

save project

parent 0086e0b9
Showing with 4 additions and 3 deletions
...@@ -45,6 +45,10 @@ class Note(): # 便签、笔记 ...@@ -45,6 +45,10 @@ class Note(): # 便签、笔记
def remove(self): def remove(self):
num=self.v.get() num=self.v.get()
alist.pop(num) alist.pop(num)
content = json.dumps(users)
with open("user.txt", "w", encoding="utf-8") as file: # "w"每次写入都覆盖原来的内容
file.write(content)
self.canvas.destroy() self.canvas.destroy()
app.show() app.show()
...@@ -93,9 +97,6 @@ def register(): # 注册验证 ...@@ -93,9 +97,6 @@ def register(): # 注册验证
messagebox.showwarning("错误", "两次密码不一致!") messagebox.showwarning("错误", "两次密码不一致!")
else: else:
users[name] = password1 users[name] = password1
content = json.dumps(users)
with open("user.txt", "w", encoding="utf-8") as file: # "w"每次写入都覆盖原来的内容
file.write(content)
# 注册成功,跳往登陆界面 # 注册成功,跳往登陆界面
messagebox.showinfo("成功", "注册成功") messagebox.showinfo("成功", "注册成功")
reg_to_login() reg_to_login()
......
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