Ошибка в программе pygame

import pygame

pygame.init() 
screen = pygame.display.set_mode((600, 300)) 
pygame.display.set_caption()

running = True 
while True: 

    pygame.display.update() 

    for event in pygame.event.get(): 
        if event.type == pygame.QUIT: 
            running = False
            pygame.quit()
Traceback (most recent call last):
  File "/home/nickv/file Code/project/project_other/other/oth.py", line 9, in <module>
    pygame.display.update() # с помощью этой строчки мы все время обновляем наш экран
    ^^^^^^^^^^^^^^^^^^^^^^^
pygame.error: video system not initialized

Что это за проблема и как ее исправить?


Ответы (1 шт):

Автор решения: zSakhalin

вот тут есть похожий вопрос. мне помогла замена pygame.quit() на exit()

ну и как уже сказали выше pygame.display.set_caption(<нужен заголовок сюда>)

→ Ссылка