python 文件批量改名重命名 rename

path = '/Volumes/Seagate/dev/imgs/'
os.chdir(path)
print('cwd: ', os.getcwd())

for f in os.listdir('.'):
    if not f.endswith('.jpg'):
        os.rename(f, f + '.jpg')

posted on 2020-09-02 11:01  明天有风吹  阅读(661)  评论(0编辑  收藏  举报

导航

+V atob('d2h5X251bGw=')

请备注:from博客园