Python 代码:批量替换文件名中的 '+' 为 ':'
import os
folder_path = r'C:\Users\Administrator\Desktop\xuexi'
for root, dirs, files in os.walk(folder_path):
for file in files:
old_name = os.path.join(root, file)
new_name = os.path.join(root, file.replace('+', ':'))
os.rename(old_name, new_name)
原文地址: https://www.cveoy.top/t/topic/m0wt 著作权归作者所有。请勿转载和采集!