Commit b7e797c7 by BellCodeEditor

save project

parent cdb641a7
Showing with 14 additions and 6 deletions
ord2 = self.e3.get()
return self.name, self.password1, self.password2
app_login = My_login()import tkinter
import tkinter
from tkinter import *
from tkinter import messagebox
......@@ -47,6 +45,9 @@ class Note(): # 便签、笔记
def remove(self):
num=self.variable.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()
......@@ -55,6 +56,9 @@ class Note(): # 便签、笔记
self.ent.delete("0", END)
if info != "":
alist.append(info)
content = json.dumps(users)
with open("user.txt", "w", encoding="utf-8") as file: # "w"每次写入都覆盖原来的内容
file.write(content)
self.canvas.create_text(40,self.y,text=info,font=("宋体",11),
anchor=W, fill='#FF9900')
self.select=tkinter.Radiobutton(self.canvas,image=self.box,
......@@ -107,10 +111,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:
if user_name != None and user_name["password"]==password:
alist=user[name]["event"]
app_login.root.destroy()
app = Note()
app.show()
......@@ -205,6 +210,9 @@ class My_register(): # 注册窗口
def get_input(self): # 获取提交的注册信息
self.name = self.e1.get()
self.password1 = self.e2.get()
self.passw
self.passwword2 = self.e3.get()
return self.name, self.password1, self.password2
app_login = My_login()
app_login.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