如果你对这篇文章可感兴趣,可以点击「【访客必读 - 指引页】一文囊括主页内所有高质量博客」,查看完整博客分类与对应链接。
步骤
关键点:os.rename 只能传入绝对路径
示例代码:
import os
for x in range(595, 791):
y = x - 19
src = os.path.join(os.getcwd(), f'seq_{x}.jpg')
dst = os.path.join(os.getcwd(), f'seq_{y}.jpg')
os.rename(src, dst)



