Open Webcam With Opencv

cap = self.get_video_capture() Although the camera light was on while the this code were being written, the camera tab would not open.
cap = cv2.VideoCapture(0, cv2.CAP_DSHOW) After replacing with these codes, the camera tab started to open.

please, NO useless screenshots of your ide here.

post code / errors as TEXT, thank you.