Python 画数码数字8

import turtle
size = 10
line = 40
# 拿出笔
pen = turtle.Pen()

pen.pensize(size)
pen.pencolor("blue")

turtle.tracer(False)  # 不跟踪动画

pen.penup()
pen.forward(size)
pen.pendown()
pen.forward(line)
pen.penup()
pen.forward(size)
pen.pendown()

pen.left(90)

pen.penup()
pen.forward(size)
pen.pendown()
pen.forward(line)
pen.penup()
pen.forward(size)
pen.pendown()

pen.left(90)

pen.penup()
pen.forward(size)
pen.pendown()
pen.forward(line)
pen.penup()
pen.forward(size)
pen.pendown()

pen.left(90)

pen.penup()
pen.forward(size)
pen.pendown()
pen.forward(line)
pen.penup()
pen.forward(size)
pen.pendown()

pen.penup()
pen.forward(size)
pen.pendown()
pen.forward(line)
pen.penup()
pen.forward(size)
pen.pendown()

pen.left(90)

pen.penup()
pen.forward(size)
pen.pendown()
pen.forward(line)
pen.penup()
pen.forward(size)
pen.pendown()

pen.left(90)

pen.penup()
pen.forward(size)
pen.pendown()
pen.forward(line)
pen.penup()
pen.forward(size)
pen.pendown()

pen.hideturtle() #隐藏

turtle.tracer(True)  # 回复效果

turtle.done() #结束

 

上一篇:画小猪佩奇


下一篇:VS2012 C# Visual studio 2012 打开时显示最近打开的解决方案记录