pad folder names

This commit is contained in:
Ville Rantanen
2021-04-20 18:41:22 +03:00
parent 900f54e3ef
commit 8d0b3145ea

View File

@@ -190,8 +190,9 @@ if method == "regexp":
(outFolders, uniqlabel, matcher) = regexmatches(inFiles, options) (outFolders, uniqlabel, matcher) = regexmatches(inFiles, options)
input("correct?") input("correct?")
else: else:
padding = "{:0" + str(len(str(options.n))) + "d}"
for x in range(options.n): for x in range(options.n):
outFolders.append(os.path.join(options.path, "folder" + str(x + 1))) outFolders.append(os.path.join(options.path, ("folder-" + padding).format(x + 1)))
for x in outFolders: for x in outFolders:
if not os.path.isdir(x): if not os.path.isdir(x):