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
09a606ef
authored
Mar 28, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
c2f1308f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
2 deletions
diy1.py
diy2.py
diy1.py
View file @
09a606ef
# 利用write()帮助悟空给诺依回信吧~
# 利用write()帮助悟空给诺依回信吧~
\ No newline at end of file
#导入这个画笔工具包
import
turtle
#创建画笔
pen1
=
turtle
.
Pen
()
pen1
.
hideturtle
()
pen1
.
write
(
"王邓小义你在干嘛?"
,
font
=
(
"Times"
,
5
,
"normal"
))
turtle
.
done
()
\ No newline at end of file
diy2.py
0 → 100644
View file @
09a606ef
#导入这个画笔工具包
import
turtle
pen1
=
turtle
.
Pen
()
#创建画笔
pen1
.
penup
()
#抬笔
pen1
.
goto
(
100
,
-
100
)
#移动到右下
screen1
=
turtle
.
Screen
()
#创建画布角色
screen1
.
bgcolor
(
"light blue"
)
#设置画布的背景颜色
len1
=
screen1
.
textinput
(
"提示"
,
"您要画的爱心大小是多少?"
)
#设置弹窗
lovesize
=
int
(
len1
)
#转换数据类型
pen1
.
hideturtle
()
#隐藏画笔的箭头
pen1
.
write
(
"王邓小义你在干嘛?"
,
font
=
(
"Times"
,
15
,
"normal"
))
#写一段话,设置字体,字体大小...
pen2
=
turtle
.
Pen
()
#创建画笔工具包
pen2
.
pensize
(
5
)
#设置画笔的大小
pen2
.
pencolor
(
"red"
)
#设置画笔的颜色
pen2
.
left
(
45
)
#画爱心
pen2
.
forward
(
2
*
lovesize
)
pen2
.
circle
(
lovesize
,
180
)
pen2
.
right
(
90
)
pen2
.
circle
(
lovesize
,
180
)
pen2
.
forward
(
2
*
lovesize
)
#隐藏画笔箭头
pen2
.
hideturtle
()
#调出画布
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