you only need to change the path to your video to a webcam id (-1,0,1,2,etc) like
cap = cv2.VideoCapture(0)