Commit 8b2767d9 by BellCodeEditor

auto save

parent 0e649d42
Showing with 51 additions and 6 deletions
# 利用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()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment