Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson3-4-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
45e12eb4
authored
Apr 04, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
386731ff
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
22 deletions
diy1.py
diy1.py
View file @
45e12eb4
# 利用write()帮助悟空给诺依回信吧~
import
turtle
#导入turtle模块
screen
=
turtle
.
Screen
()
#设置屏幕
screen
.
bgcolor
(
"black"
)
#
pen
=
turtle
.
Pen
()
#
pen
.
pencolor
(
"yellow"
)
#
pen
.
penup
()
#
pen
.
goto
(
100
,
-
100
)
#
pen
.
write
(
"你好,
\n
诺依."
,
font
=
(
"Times"
,
20
,
"normal"
))
#
pen
.
hideturtle
()
#
pen1
=
turtle
.
Pen
()
#
pen1
.
pensize
(
5
)
#
pen1
.
pencolor
(
"red"
)
#
pen1
.
fillcolor
(
"red"
)
#
pen1
.
left
(
45
)
#
pen1
.
begin_fill
()
#
pen1
.
forward
(
100
)
#
pen1
.
circle
(
45
,
180
)
#
pen1
.
right
(
95
)
#
pen1
.
circle
(
45
,
180
)
#
pen1
.
forward
(
100
)
#
pen1
.
end_fill
()
#
pen1
.
hideturtle
()
#
turtle
.
done
()
#
\ No newline at end of file
screen
.
bgcolor
(
"black"
)
#设置屏幕颜色
pen
=
turtle
.
Pen
()
#创建pen
pen
.
pencolor
(
"yellow"
)
#设置画笔颜色
pen
.
penup
()
#台笔
pen
.
goto
(
100
,
-
100
)
pen
.
write
(
"节日,
\n
快乐."
,
font
=
(
"Times"
,
20
,
"normal"
))
#写
len
=
90
pen
.
hideturtle
()
#隐藏
pen1
=
turtle
.
Pen
()
#创建pen1
pen1
.
pensize
(
5
)
#设置pen1的粗细
pen1
.
pencolor
(
"red"
)
#设置pen1的颜色
pen1
.
fillcolor
(
"red"
)
#设置填充颜色
pen1
.
left
(
45
)
#左转
pen1
.
begin_fill
()
#设置起点
pen1
.
forward
(
2
*
len
)
#走
pen1
.
circle
(
len
,
180
)
#设置圆的半径和夹角
pen1
.
right
(
90
)
#右转
pen1
.
circle
(
len
,
180
)
#设置圆的半径和夹角
pen1
.
forward
(
2
*
len
)
#走
pen1
.
end_fill
()
#设置终点
pen1
.
hideturtle
()
#隐藏pen1
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