示例#1
0
canvas.pack(ipadx=30)
root = TurtleScreen(canvas)
turtle = RawTurtle(root, visible=False)
root.bgcolor("white")

turtle.color('#F09F13')
turtle.pensize(4)
turtle.speed(15)
turtle.hideturtle()

turtle.penup()
turtle.setposition(70, 90)
turtle.pendown()
turtle.fillcolor("#F09F13")
turtle.begin_fill()
turtle.circle(40)
turtle.end_fill()

turtle.hideturtle()

turtle.color('#fe7d96')
turtle.pensize(4)
turtle.speed(15)
turtle.hideturtle()
turtle.penup()
turtle.setposition(15, -20)
turtle.hideturtle()
turtle.pendown()
turtle.fillcolor("#fe7d96")
turtle.begin_fill()
turtle.circle(50)
示例#2
0
from turtle import TurtleScreen, RawTurtle, TK
root = TK.Tk()
cv1 = TK.Canvas(root, width=500, height=500, bg="#ddffff")
cv1.pack()
s1 = TurtleScreen(cv1)
s1.bgcolor("orange")
p = RawTurtle(s1)
t = RawTurtle(s1)

p.begin_fill()
p.circle(60)
p.end_fill()

TK.mainloop()
示例#3
0
# Draw squadron NN patch (your code goes here)

#get turtle in position for first side of triangle
sammy.up()
sammy.left(90)
sammy.forward(50)
sammy.right(90)

#draw first side of triangle
sammy.down()
sammy.forward(75)
sammy.backward(150)

#draw second side of triangle
sammy.left(300)
sammy.forward(150)

#draw final side of triangle
sammy.left(120)
sammy.forward(150)

#setup and draw the 2
sammy.up()
sammy.setposition(0, 0)
sammy.down()
sammy.circle(25, 150)

# Keep the window open until the user closes it.
TK.mainloop()