(?path里面只有文件夹,没文件)
import os # for folder renumbering path = '' file_list = os.listdir(path) i = 1 for file in file_list: old = os.path.join(path, file) new = os.path.join(path, str(i)) os.rename(old, new) i += 1
效果图