this is my code. I am using the turtle module to just write some text on the screen for a project for school. But whenever I do this, the program crashes/stops responding and I was wondering if it is possible to prevent this from happening.
screen = turtle.Screen()
screen.screensize(500, 500, "pink")
drawingpen = turtle.Turtle()
for side in range(4):
y = 243
for x in range(10):
drawingpen.write("Test", False, align="center", font=("Arial", 18, "normal"))
y = y - 57
Your code hasn't crashed, it just ran out of code to process. The code that is there is working fine and as expect.
To see what I mean add:
to the end of your code. You will see the console prints the word "END" after your text is finished printing. But a nicer way might be to add:
to the end. This will close the window when you click on it.