Save yourself a trip to the emergency room and use SimpleCV. It's a Pythonic wrapper for OpenCV's Python bindings and a few more tools (it uses Numpy, Scipy and PIL):
from SimpleCV import *
camera = Camera()
image = camera.getImage()
image.save('test.JPG')