码迷,mamicode.com
首页 > 编程语言 > 详细

Python Turtle

时间:2016-11-05 02:58:20      阅读:243      评论:0      收藏:0      [点我收藏+]

标签:one   角度   import   yellow   got   nbsp   turtle   fill   down   

    之前对这个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

标签:one   角度   import   yellow   got   nbsp   turtle   fill   down   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!