pip install pygame
import pygame as pg
from pygame.locals import *
pg.init()
width, height = 600, 400
screen = pg.display.set_mode((width, height))
pg.display.set_caption('My Game')
running = True
while running:
for event in pg.event.get():
if event.type == QUIT:
running = False
pg.quit()
pg.quit()