#!/usr/bin/python3
import cv2
cam=cv2.VideoCapture(0)
checking if camera is working!!
cam.isOpened():
print("Working")
while(cam.isOpened()):
status,frame=cam.read()
cv2.imshow('camera1',frame)
if cv2.waitKey(1) & 0xFF==ord('q') :
break
Removing windows by calling below function
If i dont write this function then also it will run properly!!
cv2.destroyAllWindows()
cam.release()