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
c29f6f90
authored
Sep 03, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
e11aa9a3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
my_window.py
user.txt
my_window.py
View file @
c29f6f90
import
tkinter
import
tkinter
def
register
():
def
register
():
print
(
"dianjile"
)
name
=
e1
.
get
()
print
(
"yonghumingshi"
+
name
)
password
=
e3
.
get
()
password
=
e3
.
get
()
print
(
"mimashi"
+
password
)
password1
=
e2
.
get
()
password1
=
e2
.
get
()
print
(
"querenmimashi"
+
password1
)
name
=
e1
.
get
()
filer
=
open
(
r"c:\Users\Windows 10\Documents\level3-lesson17-diy3\user.txt"
,
"w"
,
encoding
=
"utf-8"
)
filer
.
write
(
""
+
name
)
filer
.
write
(
""
+
password1
)
filer
.
close
()
# 建立窗口对象
# 建立窗口对象
root
=
tkinter
.
Tk
()
root
=
tkinter
.
Tk
()
root
.
title
(
"注册"
)
# 设置窗口标题
root
.
title
(
"注册"
)
# 设置窗口标题
...
@@ -41,4 +43,5 @@ lab3.place(x=30,y=140)
...
@@ -41,4 +43,5 @@ lab3.place(x=30,y=140)
button1
=
tkinter
.
Button
(
root
,
text
=
"提交"
,
bg
=
"lightgreen"
,
width
=
15
,
button1
=
tkinter
.
Button
(
root
,
text
=
"提交"
,
bg
=
"lightgreen"
,
width
=
15
,
command
=
register
)
command
=
register
)
button1
.
place
(
x
=
150
,
y
=
250
)
button1
.
place
(
x
=
150
,
y
=
250
)
root
.
mainloop
()
root
.
mainloop
()
user.txt
0 → 100644
View file @
c29f6f90
3213133213213123
\ No newline at end of file
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