This is script for get picture from cam. I'm using endles loop "While True" for get the picture for realtime. you can learn this script for base of image processing with Python script and OpenCV library. If you using Raspberry PI and Raspbian operating system, you must install OpenCV library first, use this command in your terminal:
"sudo apt-get install python-opencv"
for download the script TestCam.py
keyword: OpenCV, Python, Raspberry PI, Get Picture