Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
level3-lesson18-diy2
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
12a18daf
authored
Jun 25, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
01f58358
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
my_app.py
users.text
my_app.py
View file @
12a18daf
import
tkinter
import
tkinter
from
tkinter
import
messagebox
from
tkinter
import
messagebox
import
json
import
json
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
()
users
=
json
.
loads
(
info
)
users
=
json
.
loads
(
info
)
def
login_to_reg
():
# 登录界面转注册界面
def
login_to_reg
():
# 登录界面转注册界面
app_login
.
root
.
destroy
()
app_login
.
root
.
destroy
()
global
app_reg
global
app_reg
...
@@ -29,7 +31,7 @@ def register(): # 注册验证
...
@@ -29,7 +31,7 @@ def register(): # 注册验证
with
open
(
'users.text'
,
'w'
,
encoding
=
'utf-8'
)
as
flie
:
with
open
(
'users.text'
,
'w'
,
encoding
=
'utf-8'
)
as
flie
:
flie
.
write
(
content
)
flie
.
write
(
content
)
messagebox
.
showinfo
(
'完成'
,
'信息保存成功!'
)
messagebox
.
showinfo
(
'完成'
,
'信息保存成功!'
)
login_show
()
reg_to_login
()
def
login
():
# 登录验证
def
login
():
# 登录验证
pass
pass
...
...
users.text
View file @
12a18daf
{"admin": "123456", "dsa": "123"}
{"admin": "123456", "as": "as"}
\ 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