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
0aa5d1e6
authored
May 03, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
189e63e0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
code.py
code.py
View file @
0aa5d1e6
...
@@ -55,13 +55,13 @@ class My_login(): # 登录窗口
...
@@ -55,13 +55,13 @@ class My_login(): # 登录窗口
def
show
(
self
):
# 登录界面的所有控件 l = tkinter.Label(self.root, text='您好!请登录', bg='g
def
show
(
self
):
# 登录界面的所有控件 l = tkinter.Label(self.root, text='您好!请登录', bg='g
# Label文本标签,界面提示信息
# Label文本标签,界面提示信息
l
=
tkinter
.
Label
(
self
.
root
,
text
=
'用户名:'
,
font
=
(
"宋体"
,
12
)
reen
'
,
l
=
tkinter
.
Label
(
self
.
root
,
text
=
'用户名:'
,
font
=
(
"宋体"
,
12
),
reen
,
f
ont=('
宋体
', 15), width=40, height=2)
font
=
(
'宋体'
,
15
),
width
=
40
,
height
=
2
)
l
.
place
(
x
=
0
,
y
=
0
),
l
.
place
(
x
=
0
,
y
=
0
),
fg="black")
l
.
place
(
x
=
50
,
y
=
80
)
l
.
place
(
x
=
50
,
y
=
80
)
l
=
tkinter
.
Label
(
self
.
root
,
text
=
'密 码:'
,
font
=
(
"宋体"
,
12
),
l
=
tkinter
.
Label
(
self
.
root
,
text
=
'密 码:'
,
font
=
(
"宋体"
,
12
),
f
g="black")
b
g
=
"black"
)
l
.
place
(
x
=
50
,
y
=
140
)
l
.
place
(
x
=
50
,
y
=
140
)
# Entry单行文本输入框:用户名、密码
# Entry单行文本输入框:用户名、密码
...
@@ -75,7 +75,7 @@ class My_login(): # 登录窗口
...
@@ -75,7 +75,7 @@ class My_login(): # 登录窗口
self
.
v
=
IntVar
()
self
.
v
=
IntVar
()
# 登录、注册按钮
# 登录、注册按钮
button1
=
tkinter
.
Button
(
self
.
root
,
text
=
'登录'
,
bg
=
"lightblue"
,
button1
=
tkinter
.
Button
(
self
.
root
,
text
=
'登录'
,
bg
=
"lightblue"
,
f
g="black", width=15, command=login)
b
g
=
"black"
,
width
=
15
,
command
=
login
)
button1
.
place
(
x
=
60
,
y
=
220
)
button1
.
place
(
x
=
60
,
y
=
220
)
button2
=
tkinter
.
Button
(
self
.
root
,
text
=
'注册'
,
bg
=
"lightgreen"
,
button2
=
tkinter
.
Button
(
self
.
root
,
text
=
'注册'
,
bg
=
"lightgreen"
,
fg
=
"black"
,
width
=
15
,
command
=
login_to_reg
)
fg
=
"black"
,
width
=
15
,
command
=
login_to_reg
)
...
@@ -97,7 +97,7 @@ class My_register(): # 注册窗口
...
@@ -97,7 +97,7 @@ class My_register(): # 注册窗口
def
show
(
self
):
# 注册界面的所有控件
def
show
(
self
):
# 注册界面的所有控件
# 用户名、密码、确认密码输入框
# 用户名、密码、确认密码输入框
self
.
e1
=
tkinter
.
Entry
(
self
.
root
,
show
=
None
,
font
=
(
'宋体'
,
14
),
self
.
e1
=
tkinter
.
Entry
(
self
.
root
,
show
=
None
,
font
=
(
'宋体'
,
14
),
bg
=
"light grey", width=18) # 显示成明文形式
bg
=
"light grey"
,
width
=
18
)
# 显示成明文形式
self
.
e1
.
place
(
x
=
140
,
y
=
80
)
self
.
e1
.
place
(
x
=
140
,
y
=
80
)
self
.
e2
=
tkinter
.
Entry
(
self
.
root
,
show
=
'*'
,
font
=
(
'宋体'
,
14
),
self
.
e2
=
tkinter
.
Entry
(
self
.
root
,
show
=
'*'
,
font
=
(
'宋体'
,
14
),
width
=
18
)
width
=
18
)
...
...
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