i have a simple webcam opening using cv2 module:
cap=cv2.VideoCapture(0)
while True:
ret, img = cap.read()
cv2.imshow('webcam',img)
k=cv2.waitKey(10)
if k == 27:
break
cap.release()
cv2.destroyWindows()
this program runs for ever, although i try to close it, the only way is closing vsCode