from os import listdir
from os.path import isfile
some_path = "enter your path here"
folder_contents = os.listdir(".")
for item in folder_contents:
if os.path.isfile(item):
do_something(item)
import os
import cv2 as cv
dirpath = '/path/to/your/video/dir'
os.chdir(dirpath)
# assuming inside the folder, all the files are video file type
video_list = os.listdir('.')
for video in video_list:
cap = cv.VideoCapture('./' + video)
试试这个:
让我们试试这个:
相关问题 更多 >
编程相关推荐