编程语言
首页 > 编程语言> > 简单python 表白代码

简单python 表白代码

作者:互联网

# 导入模块
import turtle

# 人
turtle.penup()
turtle.goto(-100, 100)
turtle.pendown()
turtle.color('yellow')
turtle.setheading(55)
turtle.circle(50, 280)
turtle.setheading(238)
turtle.forward(145)
turtle.setheading(-45)
turtle.circle(165, 85)
turtle.setheading(120)
turtle.forward(175)
turtle.penup()
turtle.goto(-120, 120)
turtle.pendown()
turtle.forward(25)
turtle.penup()
turtle.goto(-100, 140)
turtle.pendown()
turtle.forward(10)
turtle.penup()
turtle.goto(-110, 105)
turtle.pendown()
turtle.setheading(15)
turtle.circle(10, 60)
turtle.penup()
turtle.goto(-145, -105)
turtle.pendown()
turtle.setheading(-90)
turtle.forward(50)
turtle.penup()
turtle.goto(-100, -105)
turtle.pendown()
turtle.setheading(-90)
turtle.forward(50)
turtle.penup()
turtle.goto(-80, 65)
turtle.pendown()
turtle.setheading(30)
turtle.forward(65)
turtle.circle(10, 70)
turtle.forward(5)
turtle.circle(8, 60)
turtle.setheading(60)
turtle.circle(-5, 90)
turtle.setheading(-80)
turtle.forward(10)
turtle.setheading(30)
turtle.forward(18)
turtle.circle(-2, 180)
turtle.setheading(-150)
turtle.forward(19)
for i in range(1, 4, 1):
turtle.setheading(30)
turtle.forward(4)
turtle.circle(-2.2, 180)
turtle.forward(4.2)
turtle.setheading(170)
turtle.circle(-10, 36)
turtle.setheading(210)
turtle.forward(75)

# 心
turtle.penup()
turtle.goto(70, 90)
turtle.pendown()
turtle.color('red')
turtle.begin_fill()
turtle.fillcolor()
turtle.setheading(135)
turtle.forward(80)
turtle.circle(-40, 180)
turtle.setheading(45)
turtle.circle(-40, 180)
turtle.forward(80)
turtle.end_fill()

# 心中填字
turtle.penup()
turtle.goto(48, 155)
turtle.pendown()
turtle.color('yellow')
turtle.write('I Love You')

# 移动右下方填字
turtle.penup()
turtle.goto(200, -300)
turtle.pendown()
turtle.color('blue')
turtle.write('喜欢是棋逢对手,但爱是甘拜下风!')
turtle.hideturtle()
turtle.done()

标签:turtle,表白,python,代码,penup,setheading,pendown,forward,circle
来源: https://www.cnblogs.com/Redskaber/p/14290168.html