Commit 8fdd580d by BellCodeEditor

save project

parent d1aac6be
Showing with 11 additions and 5 deletions
import tkinter import tkinter
from tkinter import messagebox from tkinter import messagebox
import json import json
from os import system
with open("user.txt", "r", encoding="utf-8") as f: with open("user.txt", "r", encoding="utf-8") as f:
info = f.read() info = f.read()
...@@ -40,6 +41,8 @@ def login(): # 登录验证 ...@@ -40,6 +41,8 @@ def login(): # 登录验证
pwd = users.get(name) pwd = users.get(name)
if pwd == password: if pwd == password:
messagebox.showinfo("成功", "登录成功") messagebox.showinfo("成功", "登录成功")
app_login.root.destroy()
system("call my_client.py")
else: else:
messagebox.showwarning("错误", "用户名或密码错误!") messagebox.showwarning("错误", "用户名或密码错误!")
......
...@@ -5,6 +5,7 @@ alist = ["星期六下午打篮球", "星期天下午和小美一起看电影", ...@@ -5,6 +5,7 @@ alist = ["星期六下午打篮球", "星期天下午和小美一起看电影",
"12月18日给蒂法过生日", "12.24送妈妈圣诞礼物"] "12月18日给蒂法过生日", "12.24送妈妈圣诞礼物"]
unlocklist={} unlocklist={}
infolist={}
class Note(): # 便签、笔记 class Note(): # 便签、笔记
def __init__(self): def __init__(self):
...@@ -32,11 +33,12 @@ class Note(): # 便签、笔记 ...@@ -32,11 +33,12 @@ class Note(): # 便签、笔记
i=0 i=0
for info in alist: for info in alist:
va=IntVar() va=IntVar()
va.set(i) va.set(0)
# self.checklock(i,info)
self.canvas.create_text(40, self.y, text=info, self.canvas.create_text(40, self.y, text=info,
font=("宋体", 11), anchor=W, fill='#FF9900') font=("宋体", 11), anchor=W, fill='#FF9900')
b=Checkbutton(width=1,height=1,variable=va,bg='#FFFAE0',command=lambda: b=Checkbutton(width=1,height=1,onvalue=i,variable=va,bg='#FFFAE0',command=lambda:
self.unlock(va,alist.index(info),info)).place(x=0,y=self.y-18) self.unlock(va,i,info)).place(x=0,y=self.y-18)
i+=1 i+=1
self.y += 30 self.y += 30
...@@ -49,6 +51,7 @@ class Note(): # 便签、笔记 ...@@ -49,6 +51,7 @@ class Note(): # 便签、笔记
# unlocklist.pop(info) # unlocklist.pop(info)
# print(unlocklist) # print(unlocklist)
def get_info(self): def get_info(self):
info = self.ent.get() info = self.ent.get()
self.ent.delete("0", END) self.ent.delete("0", END)
......
{"admin": "admin", "python": "123456"} {"admin": "admin", "python": "123456", "1": "123"}
\ No newline at end of file \ 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