Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson3-1-1_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
b128bcf1
authored
Dec 22, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
3d149e2d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
2 deletions
diy1.py
test.py
diy1.py
View file @
b128bcf1
# 利用write()帮助悟空给诺依回信吧~
\ No newline at end of file
# 导入turtle
import
turtle
# 定义画笔 1画心 2祝福语
pen1
=
turtle
.
Pen
()
pen2
=
turtle
.
Pen
()
#定义画布
screen
=
turtle
.
Screen
()
#定义画布颜色
screen
.
bgcolor
(
"yellow"
)
# 设置变量 len 半径
len
=
100
# pen1 画心
pen1
.
penup
()
pen1
.
goto
(
0
,
-
50
)
pen1
.
pendown
()
pen1
.
pensize
(
10
)
pen1
.
pencolor
(
"red"
)
pen1
.
fillcolor
(
"red"
)
pen1
.
hideturtle
()
pen1
.
begin_fill
()
pen1
.
left
(
45
)
pen1
.
forward
(
2
*
len
)
pen1
.
circle
(
len
,
180
)
pen1
.
right
(
90
)
pen1
.
circle
(
len
,
180
)
pen1
.
forward
(
2
*
len
)
pen1
.
end_fill
()
# pen2 祝福语
pen2
.
penup
()
pen2
.
goto
(
100
,
-
100
)
# pen2.pencolor("red")
pen2
.
write
(
"收到你的信啦~
\n
常联系哈~"
,
font
=
(
"Times"
,
25
,
"normal"
))
pen2
.
hideturtle
()
turtle
.
done
()
\ No newline at end of file
test.py
0 → 100644
View file @
b128bcf1
import
turtle
screen
=
turtle
.
Screen
()
screen
.
textinput
(
"姓名框"
,
"你的名字是:"
)
screen
.
window_height
(
100
)
screen
.
window_width
(
100
)
turtle
.
done
()
\ 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