import cv2

# 1 import
# 2 create video capture entry
vc = cv2.VideoCapture(0)

# 3 capture picture of video continue
while True:
    ret, img = vc.read()
    if not ret:
        print('no capture video')
        break

    # 4 show picture
    cv2.imshow('me', img)
    # 5 wait keyborad
    if cv2.waitKey(1) != -1:
        # 6 close camera and windows
        vc.release()
        cv2.destroyAllWindows()
        break

049995185d3675bfa557baa4ffe1aac2e1054709
<mask token>

<mask token>
while True:
    ret, img = vc.read()
    if not ret:
        print('no capture video')
        break
    cv2.imshow('me', img)
    if cv2.waitKey(1) != -1:
        vc.release()
        cv2.destroyAllWindows()
        break

<mask token>
vc = cv2.VideoCapture(0)
while True:
    ret, img = vc.read()
    if not ret:
        print('no capture video')
        break
    cv2.imshow('me', img)
    if cv2.waitKey(1) != -1:
        vc.release()
        cv2.destroyAllWindows()
        break

import cv2
vc = cv2.VideoCapture(0)
while True:
    ret, img = vc.read()
    if not ret:
        print('no capture video')
        break
    cv2.imshow('me', img)
    if cv2.waitKey(1) != -1:
        vc.release()
        cv2.destroyAllWindows()
        break

import cv2

# 1 import
# 2 create video capture entry
vc = cv2.VideoCapture(0)

# 3 capture picture of video continue
while True:
    ret, img = vc.read()
    if not ret:
        print('no capture video')
        break

    # 4 show picture
    cv2.imshow('me', img)
    # 5 wait keyborad
    if cv2.waitKey(1) != -1:
        # 6 close camera and windows
        vc.release()
        cv2.destroyAllWindows()
        break
