甩曲彩点动图

甩曲彩点动图

python海龟画图甩曲彩点动图
python海龟画图甩曲彩点动图

python海龟画图甩曲彩点动图

"""
   甩曲彩点动图
"""
import time
import turtle

cs = ['red','orange','yellow','green',
      'cyan','gold','white','blue','purple',
      'pink','magenta','brown','gray','lime']

turtle.speed(0)
turtle.ht()
turtle.bgcolor('black')
turtle.tracer(0,0)
def draw_pattern():
    for c in cs:
        turtle.color(c)
        turtle.circle(50,130)
        turtle.dot(10)
        turtle.circle(50,-130)        
        turtle.rt(360/len(cs))

while True:
    turtle.clear()
    draw_pattern()
    turtle.rt(2)
    turtle.update()
    time.sleep(0.1)

李兴球

李兴球的博客是Python创意编程原创博客