Commit e4d088fc by BellCodeEditor

save project

parent 6e6d4f1b
Showing with 13 additions and 4 deletions
......@@ -13,6 +13,7 @@ class Note(): # 便签、笔记
self.root.title("我的便签-待办事项")
self.root.resizable(width=False, height=False)
self.bg_img = tkinter.PhotoImage(file="bg.png")
self.box = PhotoImage(file='box.png')
def show(self): # 布置窗口界面
# 画布
......@@ -44,6 +45,10 @@ class Note(): # 便签、笔记
def remove(self):
num=self.v.get()
alist.pop(num)
#更新用户代办事项
content = json.dump(users)
with open('user.txt','w',encoding='utf8')as file:
file.write(content)
self.canvas.destroy()
app.show()
......@@ -52,6 +57,9 @@ class Note(): # 便签、笔记
self.ent.delete("0", END)
if info != "":
alist.append(info)
content = json.dumps(users)
with open('user.txt','w',encoding='utf8')as file:
file.write(content)
self.canvas.create_text(40,self.y,text=info,font=("宋体",11),
anchor=W, fill='#FF9900')
self.y += 30
......@@ -86,7 +94,7 @@ def register(): # 注册验证
user_info={}
user_info['password'] = paasword1
user_info['event'] = ['提示1:可以从输入框添加新任务',
'提示2:点击前面输入框,表示任务完成']
'提示2:点击前面']
users[name] = password1
content = json.dumps(users)
with open("user.txt", "w", encoding="utf-8") as file: # "w"每次写入都覆盖原来的内容
......@@ -96,10 +104,11 @@ def register(): # 注册验证
reg_to_login()
def login():
global app # 登录验证
global app,alist # 登录验证
name, password = app_login.get_input()
pwd = users.get(name)
if pwd == password:
user_name = users.get(name)
if user_name != None and user_name['password'] == password:
alist = users[name]['event']
app_login.root.destroy()
app = Note()
app.show()
......
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