I'm designing a simple Python program that uses the Turtle graphics module to draw lines on the screen with the arrow keys.
turtle.setup(400,500) # Determine the window size
wn = turtle.Screen() # Get a reference to the window
wn.title("Handling keypresses!") # Change the window title
wn.bgcolor("lightgreen") # Set the background color
tess = turtle.Turtle() # Create our favorite turtle
# The next four functions are our "event handlers".
wn.bye() # Close down the turtle window
# These lines "wire up" keypresses to the handlers we've defined.
# Now we need to tell the window to start listening for events,
# If any of the keys that we're monitoring is pressed, its
# handler will be called.
Traceback (most recent call last):
File "C:\Users\Noah Huber-Feely\Desktop\PEN_Programming\Python\etchy_sketch1.py", line 32, in <module>
AttributeError: '_Screen' object has no attribute 'mainloop'
I suspect the reason for this is since you can make multiple screens, it makes sense to still have the
turtle module manage all of the screens instead of trying to potentially make multiple mainloops work together.