#!python # -*- coding:utf8 -*- # # pygame_sdl2 test. window display only import pygame_sdl2 pygame_sdl2.import_as_pygame() import pygame from pygame.locals import * import os SCREEN_SIZE = (640, 480) def main(): pygame.init() screen = pygame.display.set_mode( SCREEN_SIZE ) pygame.display.set_caption('Hello pygame_sdl2') while True: screen.fill((0, 0, 255)) # screen fill Blue pygame.display.update() for event in pygame.event.get(): # check event if event.type == QUIT: return if (event.type == KEYDOWN and event.key == K_ESCAPE): # push Escape key ? return if __name__ == '__main__': main()