Commit 3eb39bcb by BellCodeEditor

auto save

parent 35b6a18a
Showing with 31 additions and 0 deletions
import turtle
# 创建画布
screen = turtle.Screen()
# 设置画布颜色
screen.bgcolor("red")#设置画布颜色
# 3,创建一只写字画笔
pen = turtle.Pen()
pen.penup()#抬笔
pen.goto(133,66)
#参数分别是,内容,字体名称,字体大小,字体类型
pen.write("内\n容",font=("Times",20,"normal"))
pen.pensize()
# 创建对话框
len = screen.textinput("对话框标题","输入爱心大小")
size = int(len)
# 4,创建一只画爱心的画笔
pen1 = turtle.Pen()
# 设置画笔颜色
pen1.color()
# 画爱心
# 先设置朝向
pen1.left(45)
pen1.forward(size*2)#往前直行
pen1.circle(size,180)#第一个参数是半径,第二个参数是度数
# 隐藏画笔
pen1.hideturtle()
turtle.done()
\ No newline at end of file
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