4 except ImportError, msg:
6 print >>sys.stderr, msg
9 def show(image, caption=''):
10 if image.mode != 'RGB':
11 image = image.convert('RGB')
14 caption = "Imago: " + caption
17 pygame.display.set_caption(caption)
18 pygame.display.set_mode(image.size)
19 main_surface = pygame.display.get_surface()
20 picture = pygame.image.frombuffer(image.tostring(), image.size, image.mode)
21 main_surface.blit(picture, (0, 0))
22 pygame.display.update()
24 events = pygame.event.get()
26 if event.type == pygame.QUIT or event.type == pygame.KEYDOWN: