Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
level3-lesson17-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
66181b6f
authored
Nov 30, 2025
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
0651e310
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
1 deletions
my_window.py
my_window.py
View file @
66181b6f
import
tkinter
import
tkinter
#GUI库
a
=
tkinter
.
Tk
()
#创建一个窗口
a
.
geometry
(
"400x300+500+300"
)
#设置窗口的大小
a
.
title
(
"注册"
)
#设置标题
e
=
tkinter
.
Label
(
a
,
text
=
"请输入注册信息:"
,
font
=
(
"宋体"
,
20
),
fg
=
"black"
,
bg
=
"blue"
,
width
=
30
,
height
=
2
)
#创建文本控件,tkinter.Label(窗口,文字,字体,fg、字体颜色,bg、背景颜色,宽,高)
e
.
place
(
x
=
0
,
y
=
0
)
b
=
tkinter
.
Entry
(
a
,
show
=
None
,
font
=
(
"宋体"
,
15
),
bg
=
"light grey"
,
width
=
17
)
#创建输入控件,tkinter.Entry(窗口,show,字体,背景颜色,宽度、可显示的文字个数)
b
.
place
(
x
=
110
,
y
=
70
)
#放置控件
f
=
tkinter
.
Label
(
a
,
text
=
"账号:"
,
font
=
(
"宋体"
,
15
),
fg
=
"black"
,
width
=
15
)
f
.
place
(
x
=
0
,
y
=
70
)
c
=
tkinter
.
Entry
(
a
,
show
=
None
,
font
=
(
"宋体"
,
15
),
bg
=
"light grey"
,
width
=
17
)
c
.
place
(
x
=
110
,
y
=
120
)
g
=
tkinter
.
Label
(
a
,
text
=
"密码:"
,
font
=
(
"宋体"
,
15
),
fg
=
"black"
,
width
=
15
)
g
.
place
(
x
=
0
,
y
=
120
)
d
=
tkinter
.
Entry
(
a
,
show
=
None
,
font
=
(
"宋体"
,
15
),
bg
=
"light grey"
,
width
=
17
)
d
.
place
(
x
=
110
,
y
=
170
)
h
=
tkinter
.
Label
(
a
,
text
=
"确认密码:"
,
font
=
(
"宋体"
,
15
),
fg
=
"black"
,
width
=
15
)
h
.
place
(
x
=
0
,
y
=
170
)
a
.
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