标签:多少 alt img LLC goto 效果 src hide 技术
# 今年的情人节和以往并不相同,由于疫情的关系多少相恋的人没有办法见面,情人节肯定要有玫瑰花啊 ,这样显得多么的完美。于是我自己手绘了一个玫瑰送给我的爱人,给需要的人一个帮助。
# coding=utf-8
import turtle
import time
def initialization():
# 初始化画布和画笔
turtle.setup(width=0.9, height=0.9)
turtle.speed(5)
def flower():
# 勾勒花蕊
turtle.goto(0, 200)
turtle.fillcolor("red")
turtle.begin_fill()
turtle.circle(10, 180)
turtle.circle(25, 110)
turtle.left(50)
turtle.circle(60, 45)
turtle.circle(20, 170)
turtle.right(24)
turtle.fd(30)
turtle.left(10)
turtle.circle(30, 110)
turtle.fd(20)
turtle.left(40)
turtle.circle(90, 70)
turtle.circle(30, 150)
turtle.right(30)
turtle.fd(15)
turtle.circle(80, 90)
turtle.left(15)
turtle.fd(45)
turtle.right(165)
turtle.fd(20)
turtle.left(155)
turtle.circle(150, 80)
turtle.left(50)
turtle.circle(150, 90)
turtle.end_fill()
def petaOne():
# 勾勒花瓣
turtle.left(150)
turtle.circle(-90, 70)
turtle.left(20)
turtle.circle(75, 105)
turtle.setheading(60)
turtle.circle(80, 98)
turtle.circle(-90, 40)
def petaTwo():
# 勾勒花瓣
turtle.left(180)
turtle.circle(90, 40)
turtle.circle(-80, 98)
turtle.setheading(-83)
def leafOne():
# 勾勒叶子
turtle.fd(30)
turtle.left(90)
turtle.fd(25)
turtle.left(45)
turtle.fillcolor("green")
turtle.begin_fill()
turtle.circle(-80, 90)
turtle.right(90)
turtle.circle(-80, 90)
turtle.end_fill()
turtle.right(135)
turtle.fd(60)
turtle.left(180)
turtle.fd(85)
turtle.left(90)
turtle.fd(80)
def leafTwo():
# 勾勒叶子
turtle.right(90)
turtle.right(45)
turtle.fillcolor("green")
turtle.begin_fill()
turtle.circle(80, 90)
turtle.left(90)
turtle.circle(80, 90)
turtle.end_fill()
turtle.left(135)
turtle.fd(60)
turtle.left(180)
turtle.fd(60)
turtle.right(90)
turtle.circle(200, 60)
turtle.hideturtle()
def sayText():
love = "情人节快乐,祝你的每一天都可以开心"
t = turtle.Pen()
t.hideturtle()
t.penup()
t.forward(200)
t.right(100)
t.pendown()
t.write(love, font=("华文行楷",20, "bold"))
if __name__ == ‘__main__‘:
initialization()
sayText()
time.sleep(1)
flower()
petaOne()
petaTwo()
leafOne()
leafTwo()
time.sleep(5)
# 效果如下所示:
标签:多少 alt img LLC goto 效果 src hide 技术
原文地址:https://www.cnblogs.com/walxt/p/12306762.html