Installer pygame

Premier pas pygame

import inspect
import os
import pygame
 
cwd = os.getcwd()
os.chdir(os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))))
 
# init game mode
pygame.init()
 
# game window icon
icon_32x32 = pygame.image.load('icon.png') #.convert.alpha()
pygame.display.set_icon(icon_32x32)
pygame.display.set_caption('game test')
pygame.display.set_mode((1280, 768))
 
# main loop
running = True
while running:
  for event in pygame.event.get():
    if event.type == pygame.QUIT:
      running = False
  pygame.display.update()
 
# end
pygame.quit()
os.chdir(cwd)