# Take still pictures with Python from picamera import PiCamera from time import sleep camera = PiCamera() camera.rotation = 180 # You can rotate the image by 90, 180 or 270 degrees camera.start_preview() # Make the camera preview for i in range(5): sleep(5) # The camera should take one picture every five seconds. camera.capture('/home/pi/Desktop/image%s.jpg' % i) camera.stop_preview() # Recording video with Python camera.start_preview() camera.start_recording('/home/pi/Desktop/video.h264') sleep(5) camera.stop_recording() camera.stop_preview()