pygame is
Python
Simple DirectMedia Layer
 
 
pygame.org is
Site Swing
Wiki

DummyVideoDriver

      
Search:  
 
 

You can use PyGame without opening a visible display (e.g. for testing, or for integrating with other frameworks that have their own displays) by using SDL environment variables before you initialise pygame. Environment variables can be set with the os.environ dict in python.

import os
 
os.environ['SDL_VIDEODRIVER'] = 'dummy'
import pygame
pygame.init()
pygame.display.set_mode((1,1))
 
while 1:
    events = pygame.event.get()
    for e in events:
        pass

A full list of SDL environment variables can be found here.

spotlight

 
our projects
pygame.org welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
 
recent releases
Aug 21, 2014


Aug 19, 2014

Aug 18, 2014

Aug 2, 2014


Jul 28, 2014

Jul 22, 2014

Jul 21, 2014

Jul 20, 2014

Jul 19, 2014

Jul 15, 2014

... more!
 
for pygame related questions, comments, and suggestions, please see help (lists, irc)