Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Try this:

import pygame

import pygame.camera

from pygame.locals import *

pygame.init() pygame.camera.init()

cam = pygame.camera.Camera("/dev/video0",(640,480)) cam.start()

image = cam.get_image()

pygame.image.save(image, 'image.jpg')

cam.stop()

Try this:

import pygame

import pygame.camera

from pygame.locals import *

pygame.init()
pygame.camera.init()

cam = pygame.camera.Camera("/dev/video0",(640,480))
cam.start()

image = cam.get_image()

pygame.image.save(image, 'image.jpg')

cam.stop()

from pygame.locals import *

pygame.init() pygame.camera.init()

cam = pygame.camera.Camera("/dev/video0",(640,480)) cam.start()

image = cam.get_image()

pygame.image.save(image, 'image.jpg')

cam.stop()