首页 > 编程语言 > 详细

Python Turtle

时间:2016-11-05 02:55:32      阅读:665      评论:0      收藏:0      [点我收藏+]

    之前对这个turtle这个模块不了解,觉得没什么意思,最近试了一下发现不错,来点最简单的。写的时候深刻感受到自己智商是个硬伤,算角度都算了半天。。。

图就不导了吧,懒癌晚期。。。

import turtle

#I
turtle.penup()
turtle.goto(-400,100)
turtle.color("yellow")
turtle.pendown()
turtle.pensize(5)
turtle.begin_fill()
turtle.color("yellow")
turtle.forward(120)
turtle.right(90)
turtle.forward(40)
turtle.right(90)
turtle.forward(40)
turtle.right(-90)
turtle.forward(100)
turtle.right(-90)
turtle.forward(40)
turtle.right(90)
turtle.forward(40)
turtle.right(90)
turtle.forward(120)
turtle.right(90)
turtle.forward(40)
turtle.right(90)
turtle.forward(40)
turtle.right(-90)
turtle.forward(100)
turtle.right(-90)
turtle.forward(40)
turtle.right(90)
turtle.forward(40)
turtle.end_fill()



#L
turtle.penup()
turtle.goto(-260,100)
turtle.pendown()
turtle.pensize(5)
turtle.color("red")
turtle.right(180)
turtle.forward(180)
turtle.right(-90)
turtle.forward(60)
turtle.right(-90)
turtle.forward(20)
turtle.right(-90)
turtle.forward(40)
turtle.right(90)
turtle.forward(160)
turtle.right(-90)
turtle.forward(20)
turtle.end_fill()

#o
turtle.penup()
turtle.goto(-140,0)
turtle.pendown()
turtle.pensize(20)
turtle.circle(40)

#v
turtle.penup()
turtle.goto(-60,0)
turtle.pendown()
turtle.pensize(20)
turtle.right(250)
turtle.forward(80)
turtle.right(220)
turtle.forward(80)

#e
turtle.penup()
turtle.goto(40,-40)
turtle.pendown()
turtle.pensize(20)
turtle.right(70)
turtle.forward(60)
turtle.right(-90)
turtle.forward(40)
turtle.right(-90)
turtle.forward(60)
turtle.right(-90)
turtle.forward(80)
turtle.right(-90)
turtle.forward(60)

#u
turtle.penup()
turtle.goto(140,100)
turtle.pendown()
turtle.pensize(5)
turtle.color("purple")
turtle.begin_fill()
turtle.color("purple")
turtle.right(90)
turtle.forward(180)
turtle.right(-90)
turtle.forward(100)
turtle.right(-90)
turtle.forward(180)
turtle.right(-90)
turtle.forward(20)
turtle.right(-90)
turtle.forward(160)
turtle.right(90)
turtle.forward(60)
turtle.right(90)
turtle.forward(160)
turtle.right(-90)
turtle.forward(20)
turtle.end_fill()


turtle.done()



 

Python Turtle

原文:http://www.cnblogs.com/Lightening2/p/6032118.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!