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
8ca3f7ce
authored
Oct 09, 2020
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
ba952db8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
diy1.py
diy1.py
View file @
8ca3f7ce
# 利用write()帮助悟空给诺依回信吧~
import
turtle
#导入turtle模块
s
=
turtle
.
Screen
()
#新建画布
s
.
bgcolor
(
"lightpink"
)
#改变画布的背景颜色
A
=
turtle
.
Pen
()
#新建画笔
A
.
penup
()
#抬笔
A
.
goto
(
80
,
-
100
)
#移动的要写字的位置
A
.
write
(
"静夜思
\n
唐[李白]
\n
床前明月光
\n
疑是地上霜"
,
font
=
(
"STKAITI"
,
20
,
"normal"
))
#写字(“要写的内容”,字体变量=(“字体名称”,字体大小,“字体类型”))
A
.
hideturtle
()
#隐藏画笔
a
=
turtle
.
Pen
()
#新建画笔
a
.
penup
()
#抬笔
a
.
goto
(
-
50
,
-
100
)
a
.
pendown
()
#落笔
a
.
pensize
(
3
)
#设置画笔粗细
a
.
pencolor
(
"red"
)
#设置画笔颜色
len
=
90
#所画的圆的半径
a
.
left
(
45
)
a
.
forward
(
2
*
len
)
a
.
circle
(
len
,
180
)
#画圆(半径,旋转角度) 180度表示半圆
a
.
right
(
90
)
a
.
circle
(
len
,
180
)
a
.
forward
(
2
*
len
)
a
.
hideturtle
()
#隐藏画笔
turtle
.
done
()
#保持画布
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