02 - Start Game & Documentation

01

Open & Close window surface
import pygame 
from pygame.locals import *

if __name__ == "__main__":
    pygame.init()
    surface = pygame.display.set_mode((800,400))
    pygame.display.flip()

    running = True
    while running:
        for event in pygame.event.get():
            if event.type == KEYDOWN:
                print(event.key)
                if event.key == K_ESCAPE:
                    running = False
            if event.type == QUIT:
                running = False

            

02 WARNING

If pygame isn't working, try swtiching the compiler or creating a venv in the directory and installing pygame there,