from tkinter import * from turtle import RawTurtle, TurtleScreen """ Will make a tk window and a TurtleScreen with a turtle in it """ root = Tk() # the tk window can = Canvas(root) # a canvas what will turn into turtle screen tsc = TurtleScreen(can) # the screen inside tk window tur = RawTurtle(tsc) # the turtle; what you can do any turtle stuff with
Here is what the above code is Doing:
1. It makes a tk window called root
2. It makes a canvas called can
3. It makes a TurtleScreen called tsc
4. It makes a RawTurtle called tur
5. It makes the canvas into a TurtleScreen
6. It makes the TurtleScreen into a RawTurtle