from VideoCapture import Device import ImageDraw import Image import sys import pygame # init pygame pygame.init() # get cam device cam = Device() # setup screen size size = width, height = 320,240 screen = pygame.display.set_mode(size) while 1: for event in pygame.event.get(): if event.type == pygame.QUIT: sys.exit() shot = cam.getImage() shot = pygame.image.fromstring(shot.tostring(), (320,240), "RGB") screen.blit(shot, (0,0)) pygame.display.flip()