RawTurtle类测试程序

"""
   RawTurtle类测试程序
"""

from turtle import TurtleScreen, RawTurtle, TK

root = TK.Tk()   # 新建根窗口

canvas1 = TK.Canvas(root, width=300, height=200, bg="#ddffff")
canvas1.pack()

screen = TurtleScreen(canvas1)
龟1 = RawTurtle(screen)
for i in range(4):
    龟1.fd(100)
    龟1.right(90)

root.mainloop()