Answers for "How to use turtle in tkinter"

1

python how to add turtle in tkinter

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
Posted by: Guest on August-19-2021

Code answers related to "How to use turtle in tkinter"

Python Answers by Framework

Browse Popular Code Answers by Language