1.turtle
2020-09-16 本文已影响0人
酷睿i1999
海龟库turtle
turtle.showturtle()
turtle.write("xxx")
turtle.forward(100)
turtle.color("red")
turtle.left(90)
turtle.circle(50)
turtle.goto(0,0)
turtle.penup()
turtle.pendown()
turtle.width(10)
turtle.done() 放在程序的最后,使窗口持续打开。
example:
奥运五环
import turtle
turtle.width(10)
turtle.color("blue")
turtle.circle(50)
turtle.color("black")
turtle.penup()
turtle.goto(120,0)
turtle.pendown()
turtle.circle(50)
turtle.color("red")
turtle.penup()
turtle.goto(240,0)
turtle.pendown()
turtle.circle(50)
turtle.color("yellow")
turtle.penup()
turtle.goto(60,-50)
turtle.pendown()
turtle.circle(50)
turtle.color("green")
turtle.penup()
turtle.goto(180,-50)
turtle.pendown()
turtle.circle(50)
image