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
8b2767d9
authored
May 15, 2020
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
0e649d42
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
6 deletions
diy1.py
diy1.py
View file @
8b2767d9
# 利用write()帮助悟空给诺依回信吧~
#导入库
import
turtle
#常见画笔
pen
=
turtle
.
Pen
()
#创建画笔
p
=
turtle
.
Pen
()
#设置背景颜色
s
=
turtle
.
Screen
()
#颜色为浅蓝色
s
.
bgcolor
(
"light blue"
)
#抬笔
p
.
penup
()
#书写字体:
pen
.
write
(
"诺伊,我会写字啦"
,
font
=
(
"Time"
,
30
,
"normal"
))
#保存画笔
turtle
.
done
()
\ No newline at end of file
p
.
write
(
"陈祥朋~
\n
我爱你~
\n
一辈子"
,
font
=
(
"Time"
,
13
,
"normal"
))
#改变位置
p
.
goto
(
-
100
,
0
)
#落笔
p
.
pendown
()
#画笔颜色
p
.
color
(
"red"
)
#设置笔的粗细
p
.
pensize
(
5
)
#整体填充颜色
p
.
fillcolor
(
"red"
)
#开始填充
p
.
begin_fill
()
#画出圆心:
#先旋转45度
p
.
left
(
45
)
#设置弹窗
len
=
int
(
s
.
textinput
(
"提示"
,
"请输入心的大小"
))
#设置变量长度
# len = 70
#往前走100步
p
.
forward
(
2
*
len
)
#画半圆,逆时针,半圆
p
.
circle
(
len
,
180
)
#画另外一半
#先旋转方向
p
.
right
(
90
)
#先画半圆
p
.
circle
(
len
,
180
)
#直走
p
.
forward
(
2
*
len
)
#结束填充
p
.
end_fill
()
#画笔隐藏
p
.
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