Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
level3-lesson17-diy3
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
c650e551
authored
Oct 07, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
307ac72d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
0 deletions
1.py
my_window.py
1.py
0 → 100644
View file @
c650e551
w
=
tkinter
.
Tk
()
w
.
title
(
"注册"
)
w
.
geometry
(
"600x500+400+200"
)
e
=
tkinter
.
Entry
(
w
,
show
=
None
,
font
=
(
'楷体'
,
14
),
bg
=
'light grey'
,
width
=
28
)
e
.
place
(
x
=
200
,
y
=
180
)
r
=
tkinter
.
Entry
(
w
,
show
=
'1'
,
font
=
(
'楷体'
,
14
),
bg
=
'light grey'
,
width
=
28
)
r
.
place
(
x
=
200
,
y
=
220
)
t
=
tkinter
.
Entry
(
w
,
show
=
'3'
,
font
=
(
'楷体'
,
14
),
bg
=
'light grey'
,
width
=
28
)
t
.
place
(
x
=
200
,
y
=
260
)
w
.
mainloop
()
\ No newline at end of file
my_window.py
0 → 100644
View file @
c650e551
import
tkinter
def
h
():
n
=
e
.
get
()
m
=
r
.
get
()
y
=
t
.
get
()
print
(
'输入的用户名为'
,
n
)
print
(
'输入的密码为'
,
m
)
print
(
'确认密码为'
,
y
)
# 建立窗口对象
w
=
tkinter
.
Tk
()
w
.
title
(
"注册"
)
w
.
geometry
(
"600x500+400+200"
)
w
.
resizable
(
width
=
False
,
height
=
False
)
e
=
tkinter
.
Entry
(
w
,
show
=
None
,
font
=
(
'楷体'
,
14
),
bg
=
'light grey'
,
width
=
28
)
e
.
place
(
x
=
200
,
y
=
140
)
r
=
tkinter
.
Entry
(
w
,
show
=
'3'
,
font
=
(
'楷体'
,
14
),
bg
=
'light grey'
,
width
=
28
)
r
.
place
(
x
=
200
,
y
=
220
)
t
=
tkinter
.
Entry
(
w
,
show
=
'3'
,
font
=
(
'楷体'
,
14
),
bg
=
'light grey'
,
width
=
28
)
t
.
place
(
x
=
200
,
y
=
300
)
# 注册界面上的文字标签
lab1
=
tkinter
.
Label
(
w
,
text
=
'您好!请填写注册信息'
,
font
=
(
'楷体'
,
15
),
fg
=
"black"
,
width
=
60
,
height
=
2
,
bg
=
"sky blue"
)
lab1
.
place
(
x
=
0
,
y
=
0
)
# 在输入框前展示文字标签:用户名:、密 码:、确认密码:
lab
=
tkinter
.
Label
(
w
,
text
=
'用户名:'
,
font
=
(
'楷体'
,
10
),
fg
=
"black"
)
lab
.
place
(
x
=
130
,
y
=
140
)
la
=
tkinter
.
Label
(
w
,
text
=
'密 码:'
,
font
=
(
'楷体'
,
10
),
fg
=
"black"
)
la
.
place
(
x
=
130
,
y
=
220
)
l
=
tkinter
.
Label
(
w
,
text
=
'确认密码:'
,
font
=
(
'楷体'
,
10
),
fg
=
"black"
)
l
.
place
(
x
=
130
,
y
=
300
)
button
=
tkinter
.
Button
(
w
,
text
=
'提交'
,
font
=
(
'楷体'
,
14
),
bg
=
"lightgreen"
,
width
=
10
,
command
=
h
)
button
.
place
(
x
=
260
,
y
=
400
)
# 保持窗口监听,进入消息循环
w
.
mainloop
()
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