import pygame
from pygame.locals import *
import sys
SCREEN_SIZE = (640,480)
pygame.init()
screen = pygame.display.set_mode(SCREEN_SIZE)
pygame.display.set_caption("test")
while True:
screen.fill((0,0,0))
pygame.display.update()
for event in pygame.event.get():
if event.type == QUIT:sys.exit
if event.type == KEYDOWN and event.key == K_ESCAPE:sys.exit()
if event.type == KEYDOWN and event.key == K_q:sys.exit()