Commit 452449fb by BellCodeEditor

save project

parent 88b83152
Showing with 14 additions and 7 deletions
......@@ -23,7 +23,8 @@ class Note(): # 便签、笔记
self.ent = tkinter.Entry(self.root, show=None,font=('宋体', 13),bg="snow", width=25)
self.ent.place(x=10, y=310)
# 按钮
self.but = tkinter.Button(self.root,text='添加',font=('宋体', 12),bg="lightblue", width=5, command=self.get_info)
self.but = tkinter.Button(self.root,text='添加',font=('宋体', 12),
bg="lightblue", width=5, command=self.get_info)
self.but.place(x=240, y=305)
# 展示所有的文字
self.y = 20
......@@ -31,18 +32,20 @@ class Note(): # 便签、笔记
self.val = tkinter.IntVar()
for info in alist:
self.canvas.create_text(40, self.y, text=info,font=("宋体", 11), anchor=W, fill='#FF9900')
self.select = tkinter.Radiobutton(self.canvas,image=self.box_img,value=self.v,variable=self.val,width=30,height=15,borderwidth=1,command=self.move)
self.select = tkinter.Radiobutton(self.canvas,image=self.box_img,value=self.v,
variable=self.val,width=30,height=15,borderwidth=1,command=self.move)
self.select.place(x=-25,y=self.y-15)
self.v += 1
self.y += 30
def get_info(self):
info = self.ent.get()
self.ent.delete("0", END)
self.ent.delete("0", END) # 清空输入框
if info != "":
alist.append(info)
self.canvas.create_text(40,self.y,text=info,font=("宋体",11),anchor=W, fill='#FF9900')
self.select = tkinter.Radiobutton(self.canvas,image=self.box_img,value=self.v,variable=self.val,width=30,height=15,borderwidth=1,command=self.move)
self.select = tkinter.Radiobutton(self.canvas,image=self.box_img,value=self.v,
variable=self.val,width=30,height=15,borderwidth=1,command=self.move)
self.select.place(x=-25,y=self.y-15)
self.v += 1
self.y += 30
......@@ -78,7 +81,11 @@ def register(): # 注册验证
elif password1 != password2:
messagebox.showwarning("错误", "两次密码不一致!")
else:
users[name] = password1
user_info = {}
user_info['password'] = password1
user_info['event'] = ['提示1:可以从输入框添加新任务',
'提示2:点击最前面的选择框,表示任务完成']
users[name] = user_info
content = json.dumps(users)
with open("user.txt", "w", encoding="utf-8") as file:
# "w"每次写入都覆盖原来的内容
......
{"admin": "admin", "python": "123456"}
\ No newline at end of file
{"admin": "admin", "python": "123456", "123": {"password": "123", "event": ["\u63d0\u793a1\uff1a\u53ef\u4ee5\u4ece\u8f93\u5165\u6846\u6dfb\u52a0\u65b0\u4efb\u52a1", "\u63d0\u793a2\uff1a\u70b9\u51fb\u6700\u524d\u9762\u7684\u9009\u62e9\u6846\uff0c\u8868\u793a\u4efb\u52a1\u5b8c\u6210"]}}
\ No newline at end of file
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