切割视频输出目录去除空行
This commit is contained in:
+3
-3
@@ -162,12 +162,12 @@ def cutToDir(root_dir, cutList):
|
|||||||
dirIndex = 0
|
dirIndex = 0
|
||||||
pngList = sorted(os.listdir(root_dir))
|
pngList = sorted(os.listdir(root_dir))
|
||||||
dirList = []
|
dirList = []
|
||||||
dirPathString = ""
|
dirPathList = []
|
||||||
for i in range(len(cutList) + 1):
|
for i in range(len(cutList) + 1):
|
||||||
dirName = str(i).zfill(3)
|
dirName = str(i).zfill(3)
|
||||||
dirPath = os.path.join(root_dir, dirName)
|
dirPath = os.path.join(root_dir, dirName)
|
||||||
os.mkdir(dirPath)
|
os.mkdir(dirPath)
|
||||||
dirPathString += (dirPath + '\n')
|
dirPathList.append(dirPath)
|
||||||
dirList.append(dirName)
|
dirList.append(dirName)
|
||||||
for png in pngList:
|
for png in pngList:
|
||||||
src = os.path.join(root_dir, png)
|
src = os.path.join(root_dir, png)
|
||||||
@@ -176,4 +176,4 @@ def cutToDir(root_dir, cutList):
|
|||||||
if png in cutList:
|
if png in cutList:
|
||||||
dirIndex += 1
|
dirIndex += 1
|
||||||
|
|
||||||
return dirPathString
|
return "\n".join(dirPathList)
|
||||||
|
|||||||
Reference in New Issue
Block a user