Код: Выделить всё
^CTraceback (most recent call last):
File "~/normalize_filepaths.py", line 2
for root, dirs, files in os.walk(target, topdown = False):
File "", line 377, in walk
KeyboardInterrupt
Код: Выделить всё
target = "/some/path"
for root, dirs, files in os.walk(target, topdown = False):
for name in files + dirs:
filepath = os.path.join(root, name)
clean = normalize(name)
new_filepath = os.path.join(root, clean)
shutil.move(filepath, new_filepath)
Подробнее здесь: https://stackoverflow.com/questions/792 ... rnal-drive
Мобильная версия