Commit d07ce4e5 by BellCodeEditor

auto save

parent c66a449e
Showing with 22 additions and 21 deletions
# 利用write()帮助悟空给诺依回信吧~ import turtle #导入turtle模块
import turtle screen = turtle.Screen()#将Screen()方法赋值给变量screen
screen=turtle.Screen() screen.bgcolor("pink")#设置背景色
screen.bgcolor("light blue") turtle.penup() #抬笔
len=screen.textinput("100","100") turtle.goto(150,-150) #移动到(x,y)处
len=int(len)
pen=turtle.Pen() turtle.write("李白你好,\n我想邀请你\n参加诗友会\n时间在明晚八点\n————杜甫",font = ("Times",20,"normal"))#write()方法绘制文本
pen.write("你好\nSB.",font=("Times",30,"normal")) turtle.goto(0,0)
pen.hideturtle() turtle.pendown()
len=60 #绘制爱心
pen.penup() turtle.pensize(5)
pen.goto(100,100) turtle.pencolor("red")
pen.pendown() turtle.left(45)
pen.pensize(5) turtle.forward(100)
pen.pencolor("red") turtle.circle(50,180)
pen.left(45) turtle.right(90)
pen.forward(2*len) turtle.circle(50,180)
pen.circle(len,180) turtle.forward(100)
pen.right(90) #隐藏画笔
pen.circle(len,180) turtle.hideturtle()
pen.forward(2*len) #让窗口停留
turtle.done() 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