Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
level3-lesson17-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
7c8f2413
authored
Jul 14, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
ecd1a2d0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
21 deletions
my_window.py
my_window.py
View file @
7c8f2413
import
tkinter
import
tkinter
# 建立窗口对象
root
=
tkinter
.
Tk
()
# 创建窗口
root
=
tkinter
.
Tk
()
root
.
title
(
'注册'
)
# 标题
root
.
title
(
"注册"
)
# 设置窗口标题
root
.
geometry
(
'400x320+500+300'
)
# 长×宽+x坐标+y坐标
root
.
geometry
(
"400x320+500+300"
)
# 设置窗口大小
screen_name
=
tkinter
.
Entry
(
root
,
show
=
'*'
,
font
=
(
'宋体'
,
14
),
bg
=
'light grey'
,
width
=
18
)
# 设置名字窗口
screen_name
.
place
(
x
=
140
,
y
=
80
)
# 名字窗口的坐标
screen_number
=
tkinter
.
Entry
(
root
,
show
=
'*'
,
font
=
(
'宋体'
,
14
),
bg
=
'light grey'
,
width
=
18
)
# 设置密码窗口
screen_number
.
place
(
x
=
140
,
y
=
140
)
# 密码窗口的坐标
screen_numbers
=
tkinter
.
Entry
(
root
,
show
=
'*'
,
font
=
(
'宋体'
,
14
),
bg
=
'light grey'
,
width
=
18
)
# 设置确认密码窗口
screen_numbers
.
place
(
x
=
140
,
y
=
200
)
# 确认密码的坐标
lab
=
tkinter
.
Label
(
root
,
text
=
'您好!请填写注册信息'
,
font
=
(
'宋体'
,
15
),
fg
=
"black"
,
width
=
40
,
height
=
2
,
bg
=
"green"
)
# 设置提示
lab
.
place
(
x
=
0
,
y
=
0
)
# 提示坐标
text_name
=
tkinter
.
Label
(
root
,
text
=
'名字:'
,
font
=
(
'宋体'
,
15
),
fg
=
"black"
,
width
=
40
,
height
=
2
,
bg
=
"light grey"
)
# 名字提示
text_name
.
place
(
x
=
50
,
y
=
80
)
# 提示位置
text_number
=
tkinter
.
Label
(
root
,
text
=
'密码:'
,
font
=
(
'宋体'
,
15
),
fg
=
"black"
,
width
=
40
,
height
=
2
,
bg
=
"light grey"
)
# 密码提示
text_number
.
place
(
x
=
50
,
y
=
140
)
# 提示位置
text_numbers
=
tkinter
.
Label
(
root
,
text
=
'确认密码:'
,
font
=
(
'宋体'
,
15
),
fg
=
"black"
,
width
=
40
,
height
=
2
,
bg
=
"light grey"
)
# 确认密码
text_numbers
.
place
(
x
=
30
,
y
=
200
)
# 提示位置
# 输入框entry;用户输入框
root
.
mainloop
()
# 保持运行
e1
=
tkinter
.
Entry
(
root
,
show
=
None
,
font
=
(
'宋体'
,
14
),
bg
=
"light grey"
,
width
=
18
)
# 显示成明文形式
\ No newline at end of file
e1
.
place
(
x
=
140
,
y
=
80
)
# 密码输入框,左上角坐标:x:140,y:140
?
# 确认密码输入框,左上角坐标:x:140,y:200
?
# 注册界面上的文字标签
lab
=
tkinter
.
Label
(
root
,
text
=
'您好!请填写注册信息'
,
font
=
(
'宋体'
,
15
),
fg
=
"black"
,
width
=
40
,
height
=
2
,
bg
=
"green"
)
lab
.
place
(
x
=
0
,
y
=
0
)
# 在输入框前展示文字标签:用户名:、密 码:、确认密码:
?
# 保持窗口监听,进入消息循环
root
.
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