Last active
August 29, 2015 14:04
-
-
Save T31337/a2df581d6ccf03037273 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
#WebCam Test | |
import pygame,sys | |
import pygame.camera | |
from pygame.locals import * | |
pygame.init() | |
pygame.camera.init() | |
screen = pygame.display.set_mode((640,480)) | |
cam = pygame.camera.Camera("/dev/video0",(640,480)) | |
cam.start() | |
while 1: | |
image = cam.get_image() | |
screen.blit(image,(0,0)) | |
pygame.display.update() | |
for event in pygame.event.get(): | |
if event.type == pygame.QUIT: | |
sys.exit() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment