import pygame as pg
pg.init()

(sirina, visina) = (400, 400)
prozor = pg.display.set_mode((sirina, visina))

#vas kod

pg.display.update()
while pg.event.wait().type != pg.QUIT:
    pass
pg.quit()