Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
level3-lesson20-diy1
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
8fdd580d
authored
Jan 23, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
d1aac6be
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
5 deletions
code.py
my_client.py
user.txt
code.py
View file @
8fdd580d
import
tkinter
from
tkinter
import
messagebox
import
json
from
os
import
system
with
open
(
"user.txt"
,
"r"
,
encoding
=
"utf-8"
)
as
f
:
info
=
f
.
read
()
...
...
@@ -40,6 +41,8 @@ def login(): # 登录验证
pwd
=
users
.
get
(
name
)
if
pwd
==
password
:
messagebox
.
showinfo
(
"成功"
,
"登录成功"
)
app_login
.
root
.
destroy
()
system
(
"call my_client.py"
)
else
:
messagebox
.
showwarning
(
"错误"
,
"用户名或密码错误!"
)
...
...
my_client.py
View file @
8fdd580d
...
...
@@ -5,6 +5,7 @@ alist = ["星期六下午打篮球", "星期天下午和小美一起看电影",
"12月18日给蒂法过生日"
,
"12.24送妈妈圣诞礼物"
]
unlocklist
=
{}
infolist
=
{}
class
Note
():
# 便签、笔记
def
__init__
(
self
):
...
...
@@ -32,11 +33,12 @@ class Note(): # 便签、笔记
i
=
0
for
info
in
alist
:
va
=
IntVar
()
va
.
set
(
i
)
va
.
set
(
0
)
# self.checklock(i,info)
self
.
canvas
.
create_text
(
40
,
self
.
y
,
text
=
info
,
font
=
(
"宋体"
,
11
),
anchor
=
W
,
fill
=
'#FF9900'
)
b
=
Checkbutton
(
width
=
1
,
height
=
1
,
variable
=
va
,
bg
=
'#FFFAE0'
,
command
=
lambda
:
self
.
unlock
(
va
,
alist
.
index
(
info
)
,
info
))
.
place
(
x
=
0
,
y
=
self
.
y
-
18
)
b
=
Checkbutton
(
width
=
1
,
height
=
1
,
onvalue
=
i
,
variable
=
va
,
bg
=
'#FFFAE0'
,
command
=
lambda
:
self
.
unlock
(
va
,
i
,
info
))
.
place
(
x
=
0
,
y
=
self
.
y
-
18
)
i
+=
1
self
.
y
+=
30
...
...
@@ -49,6 +51,7 @@ class Note(): # 便签、笔记
# unlocklist.pop(info)
# print(unlocklist)
def
get_info
(
self
):
info
=
self
.
ent
.
get
()
self
.
ent
.
delete
(
"0"
,
END
)
...
...
user.txt
View file @
8fdd580d
{"admin": "admin", "python": "123456"}
\ No newline at end of file
{"admin": "admin", "python": "123456", "1": "123"}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment