3 except ImportError, msg:
5 print >>sys.stderr, msg
8 def show(image, caption='', name=None):
9 if image.mode != 'RGB':
10 image = image.convert('RGB')
13 caption = "Imago: " + caption
16 pygame.display.set_caption(caption)
17 pygame.display.set_mode(image.size)
18 main_surface = pygame.display.get_surface()
19 picture = pygame.image.frombuffer(image.tostring(), image.size, image.mode)
20 main_surface.blit(picture, (0, 0))
21 pygame.display.update()
23 events = pygame.event.get()
25 if event.type == pygame.QUIT or event.type == pygame.KEYDOWN: