diff --git a/my_client.py b/my_client.py index cb6a5f0..72818b9 100644 --- a/my_client.py +++ b/my_client.py @@ -53,6 +53,9 @@ class Note(): # 便签、笔记 def remove(self): num = self.v.get() alist.pop(num) + content = json.dumps(users) + with open("user.txt", "w", encoding="utf-8") as file: # "w"每次写入都覆盖原来的内容 + file.write(content) self.canvas.destroy() app.show() with open("user.txt", "r", encoding="utf-8") as f: diff --git a/user.txt b/user.txt index eede0c2..793f3a3 100644 --- a/user.txt +++ b/user.txt @@ -1 +1 @@ -{"admin": {"password": "admin", "event": ["jdfh"]}} \ No newline at end of file +{"admin": {"password": "admin", "event": []}} \ No newline at end of file