[Python] Python Turtle window crashes every 2nd time running

Discussão em 'Python' iniciado por Stack, Agosto 14, 2025.

  1. Stack

    Stack Membro Participativo

    The code below is a basic square drawing using Turtle in python.

    Running the code the first time works. But running the code again activates a Turtle window that is non-responsive and subsequently crashes every time.

    The error message includes raise Terminator and Terminator

    Restarting kernel in Spyder (Python 3.6 on a Dell Desktop) fixes the problem in that I can then run the code again successfully, but the root cause is a mystery?

    Link to another question that is similar but as yet unanswered.

    Please +1 this question if you find it worthy of an answer!!

    import turtle
    bob = turtle.Turtle()
    print(bob)
    for i in range(4):
    bob.fd(100)
    bob.lt(90)

    turtle.mainloop()

    Continue reading...

Compartilhe esta Página