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
5d5fac6c
authored
2 years ago
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
0651e310
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
1 deletions
my_window.py
my_window.py
View file @
5d5fac6c
import
tkinter
import
tkinter
def
register
():
name
=
c
.
get
()
password1
=
d
.
get
()
password2
=
e
.
get
()
print
(
"用户输入的信息为:"
,
name
,
password1
,
password2
)
root
=
tkinter
.
Tk
()
screenwidth
=
root
.
winfo_screenwidth
()
screenheight
=
root
.
winfo_screenheight
()
a
=
(
screenwidth
-
300
)
/
2
b
=
(
screenheight
-
300
)
/
2
print
(
300
*
300
+
a
+
b
)
print
(
screenwidth
,
screenheight
)
root
.
title
(
"window"
)
root
.
geometry
(
"
%
dx
%
d+
%
d+
%
d"
%
(
400
,
320
,
a
,
b
))
root
.
resizable
(
width
=
False
,
height
=
False
)
c
=
tkinter
.
Entry
(
root
,
show
=
None
,
font
=
(
"宋体"
,
14
),
width
=
18
)
c
.
place
(
x
=
130
,
y
=
60
)
d
=
tkinter
.
Entry
(
root
,
show
=
"*"
,
font
=
(
"宋体"
,
14
),
width
=
18
)
d
.
place
(
x
=
130
,
y
=
100
)
e
=
tkinter
.
Entry
(
root
,
show
=
"*"
,
font
=
(
"宋体"
,
14
),
width
=
18
)
e
.
place
(
x
=
130
,
y
=
140
)
f
=
tkinter
.
Label
(
root
,
text
=
"您好!请填写注册信息"
,
font
=
(
"宋体"
,
15
),
fg
=
"red"
)
f
.
place
(
x
=
0
,
y
=
0
)
g
=
tkinter
.
Label
(
root
,
text
=
"账号 :"
,
font
=
(
"宋体"
,
14
))
g
.
place
(
x
=
50
,
y
=
60
)
h
=
tkinter
.
Label
(
root
,
text
=
"密码 :"
,
font
=
(
"宋体"
,
14
))
h
.
place
(
x
=
50
,
y
=
100
)
i
=
tkinter
.
Label
(
root
,
text
=
"确认密码:"
,
font
=
(
"宋体"
,
14
))
i
.
place
(
x
=
30
,
y
=
140
)
j
=
tkinter
.
Button
(
root
,
text
=
"提交"
,
font
=
(
"宋体"
,
17
),
bg
=
"red"
,
command
=
register
)
j
.
place
(
x
=
180
,
y
=
200
)
root
.
mainloop
()
This diff is collapsed.
Click to expand it.
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