本文主要是介绍【Python练习】用turtle绘制五月天logo,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
没什么技术含量,先用CAD画了个草图,然后把每个线段尺寸记下来,对应转换成代码数字,代码如下
#绘制五月天logo
import turtle
turtle.setup(800,600)
turtle.width(5)
turtle.color("blue")turtle.penup()
turtle.goto(-65,0)
turtle.pendown()turtle.seth(90)
turtle.fd(125)
turtle.right(140)
turtle.fd(101.12)
turtle.left(100)
turtle.fd(101.12)
turtle.right(140)
turtle.fd(125)turtle.penup()
turtle.goto(-45,0)
turtle.pendown()turtle.left(165)
turtle.fd(170)
turtle.right(150)
turtle.fd(170)turtle.penup()
turtle.goto(0,47.54)
turtle.pendown()turtle.right(15)
turtle.fd(37.54)turtle.right(45)
turtle.fd(14.14)
turtle.right(45)
turtle.fd(55)turtle.penup()
turtle.goto(0,10)
turtle.pendown()turtle.left(135)
turtle.fd(14.14)
turtle.left(45)
turtle.fd(55)turtle.penup()
turtle.goto(0,190)
turtle.pendown()turtle.right(45)
turtle.fd(15)
turtle.left(45)
turtle.circle(10,180)
turtle.left(45)
turtle.fd(30)
turtle.right(45)
turtle.circle(-10,180)
turtle.right(45)
turtle.fd(15)turtle.done()
这篇关于【Python练习】用turtle绘制五月天logo的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!