Python OpenCV: Saving Video from Webcam

How to read frames from a webcam and save them in a video file, using Python and OpenCV.