pygame.init() This function performs the initialization and needs to be called before any other Pygame functions are called. pygame.display.set_mode((400, 300)) This function creates a so-called Surface object to draw on. We give this function a tuple representing the width and height of the surface. pygame.display.set_caption(‘Hello World!’)
Certain methods in pygame.mouse and pygame.key are also shadowed. There's no CD-ROM on OLPC-XOs, so the 'cdrom' module isn't generally useful. Keyboard and Mouse. Keyboard and mouse work approximately as they do under Pygame. We simulate repeated key-down events when a key is held down for a period in order to simulate Pygame's operation.