I'm working through Think Python chapter 4, where they tell you to type the following to see if you have the turtle module:
import turtle
bob = turtle.Turtle()
This is supposed to open a new window, but instead, it crashes my computer. I've seen it freeze my computer where I can't move the cursor or change windows, and I have to restart it. And I've also seen it close all my programs and re-open them.
I'm running Python 3.7 downloaded from Anaconda on a Macbook Air with Mojave version 10.14.6.
EDIT: When I run BenajahTX's suggestion below, I get this error message printed 16 times:
CGSTrackingRegionSetIsEnabled returned CG error 268435459
Any clue what is causing this or how to fix it?
print(turtle. tracer(0)) is used for turn off the the turtle tracer animation.
turtle is a pre-installed Python library that enables users to create pictures and shapes by providing them with a virtual canvas.
turtle. clearscreen() aka turtle. Screen(). clear() Deletes all drawing and all turtles, reseting the window to it's original state.
turtles() This function is used to return the list of turtles on the screen.
try and set the screen and mainloop
window = turtle.Screen()
window.setup(width,height)
while True:
window.update()
window.mainloop()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With