import pygame
#initialize the screen
pygame.init()
#create the screen
screen = pygame.display.set_mode((80, 600))
#tile and icon
pygame.display.set_caption("Space Invaders")
icon = pygame.image.load("spaceship.png")
pygame.display.set_icon(icon)
running = True
while running:
for event in pygame.event.get():
if event.type == pygame.quit():
running = False
my pygame window closes as soon as it opens and then it displays the error pygame.error: video system not initialized. i use the community version of visual studio 2019.