This python program freezes and then stops responding whenever I run it.
I have looked at questions on the topic before and I have tried several script changes, but nothing worked.
This is the script I wrote:
import turtle
import os
wn =turtle.Screen()
wn.bgcolor("black")
wn.title("Space Invaders")
spaceship=turtle.Turtle()
spaceship.shape("triangle")
spaceship.color("blue")
spaceship.penup()
spaceship.setheading(90)
spaceship.speed(0)
spaceship.setposition(0,-260)
#border
borderpen=turtle.Turtle()
borderpen.color("white")
borderpen.penup()
borderpen.speed(0)
borderpen.setposition(-270,-270)
borderpen.pendown()
borderpen.hideturtle()
for side in range(4):
borderpen.fd(540)
borderpen.lt(90)
input('Press ENTER to exit')
For all I know there are no errors in script. Could it be that python does not run correctly on my computer?
I tried changing a few things in the script here and there, and nothing worked. Also I added functions to move the triangle turtle, but it did not work, so I removed the functions. What could be causing this?
Some additional information:
It's running on Windows 7.
I'm using PyCharm 2020.1 as IDE.
The Python version is 3.8.2
The error message when forcing to close the turtle window is:
Description: A problem caused this program to stop interacting with Windows. Problem signature:
Problem Event Name: AppHangB1
Application Name: python.exe
Application Version: 3.8.2150.1013
Application Timestamp: 5e55a3ed
Hang Signature: c6d0
Hang Type: 0
OS Version: 6.1.7601.2.1.0.768.3
Locale ID: 1036
Additional Hang Signature 1: c6d04898adfe72bcecd0e728a9229bc4
Additional Hang Signature 2: c79c
Additional Hang Signature 3: c79c374547b3b7b755a9988556a2666b
Additional Hang Signature 4: c6d0
Additional Hang Signature 5: c6d04898adfe72bcecd0e728a9229bc4
Additional Hang Signature 6: c79c
Additional Hang Signature 7: c79c374547b3b7b755a9988556a2666b