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
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
7 deletions
code.py
my_client.py
user.txt
code.py
View file @
8fdd580d
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
(
"错误"
,
"用户名或密码错误!"
)
...
...
my_client.py
View file @
8fdd580d
...
@@ -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
...
@@ -44,10 +46,11 @@ class Note(): # 便签、笔记
...
@@ -44,10 +46,11 @@ class Note(): # 便签、笔记
global
unlocklist
global
unlocklist
print
(
var
.
get
(),
info
,
unlocklist
)
print
(
var
.
get
(),
info
,
unlocklist
)
# if var.get()==1:
# if var.get()==1:
# unlocklist[info]=index
#
unlocklist[info]=index
# else:
# else:
# 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
()
...
...
user.txt
View file @
8fdd580d
{"admin": "admin", "python": "123456"}
{"admin": "admin", "python": "123456", "1": "123"}
\ No newline at end of file
\ 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