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
4726c18b
authored
Jan 10, 2026
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
999f118c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
105 additions
and
0 deletions
nb.py
op.py
ui.py
nb.py
0 → 100644
View file @
4726c18b
op.py
0 → 100644
View file @
4726c18b
import
turtle
as
t
t
.
speed
(
20
)
#设置速度
#绘制右边红色矩形
t
.
penup
()
#抬笔
t
.
goto
(
95
,
150
)
#移动到位置
t
.
pendown
()
#落笔
t
.
color
(
"red"
,
"red"
)
#画笔颜色
t
.
begin_fill
()
#开始填充
for
a
in
range
(
2
):
#重复执行2次
t
.
forward
(
60
)
#移动60步
t
.
right
(
90
)
#右转90度
t
.
forward
(
400
)
#移动400步
t
.
right
(
90
)
#右转90度
t
.
end_fill
()
#结束填充
#在右边矩形上写字
t
.
penup
()
#抬笔
t
.
goto
(
100
,
-
250
)
#移动到位置
t
.
pendown
()
#落笔
t
.
color
(
"black"
)
#画笔颜色
t
.
write
(
"一
\n
帆
\n
风
\n
顺
\n
年
\n
年
\n
好"
,
font
=
(
"华文行楷"
,
42
))
#设置所写内容
#绘制左边红色矩形
t
.
penup
()
#抬笔
t
.
goto
(
-
155
,
150
)
#移动到位置
t
.
pendown
()
#落笔
t
.
color
(
"red"
,
"red"
)
#画笔颜色
t
.
begin_fill
()
#开始填充
for
a
in
range
(
2
):
#重复执行2次
t
.
forward
(
60
)
#移动60步
t
.
right
(
90
)
#右转90度
t
.
forward
(
400
)
#移动400步
t
.
right
(
90
)
#右转90度
t
.
end_fill
()
#结束填充
#在左边矩形上写字
t
.
penup
()
#抬笔
t
.
goto
(
-
150
,
-
250
)
#移动到位置
t
.
pendown
()
#落笔
t
.
color
(
"black"
)
#画笔颜色
t
.
write
(
"万
\n
事
\n
如
\n
意
\n
步
\n
步
\n
高"
,
font
=
(
"华文行楷"
,
42
))
#设置所写内容
#绘制横批矩形
t
.
penup
()
#抬笔
t
.
goto
(
-
100
,
190
)
#移动到位置
t
.
pendown
()
#落笔
t
.
color
(
"red"
,
"red"
)
#画笔颜色
t
.
begin_fill
()
#开始填充
for
a
in
range
(
2
):
#重复执行2次
t
.
forward
(
210
)
#移动210步
t
.
left
(
90
)
#左转90度
t
.
forward
(
60
)
#移动60步
t
.
left
(
90
)
#左转90度
t
.
end_fill
()
#结束填充
#在横批矩形上写字
t
.
color
(
"black"
)
#画笔颜色
t
.
write
(
"五福临门"
,
font
=
(
"华文行楷"
,
40
))
#设置所写内容
t
.
penup
()
t
.
goto
(
0
,
0
)
t
.
pendown
()
t
.
color
(
"red"
,
"red"
)
t
.
begin_fill
()
t
.
left
(
45
)
t
.
forward
(
80
)
t
.
left
(
90
)
t
.
forward
(
80
)
t
.
left
(
90
)
t
.
forward
(
80
)
t
.
left
(
90
)
t
.
forward
(
80
)
t
.
end_fill
()
t
.
pencolor
(
"black"
)
t
.
goto
(
-
25
,
25
)
t
.
write
(
"福"
,
font
=
(
"华文楷体"
,
40
))
t
.
hideturtle
()
#隐藏画笔
t
.
done
()
#保存画布
\ No newline at end of file
ui.py
0 → 100644
View file @
4726c18b
import
turtle
screen
=
turtle
.
Screen
()
screen
.
bgcolor
(
"pink"
)
pen
=
turtle
.
Pen
()
pen
.
penup
()
pen
.
goto
(
50
,
-
100
)
pen
.
write
(
"你好诺依
\n
我会在电脑上写字了"
,
font
=
(
"Times"
,
15
,
"normal"
))
pen
.
hideturtle
()
len
=
60
pen1
=
turtle
.
Pen
()
pen1
.
pensize
(
5
)
len
=
screen
.
textinput
(
"提示"
,
"你想要多大的爱心?"
)
lovesize
=
int
(
len
)
pen1
.
pencolor
(
"red"
)
pen1
.
left
(
45
)
pen1
.
forward
(
2
*
lovesize
)
pen1
.
circle
(
lovesize
,
180
)
pen1
.
right
(
90
)
pen1
.
circle
(
lovesize
,
180
)
pen1
.
forward
(
2
*
lovesize
)
pen1
.
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