Answers for "python script to rename all files in folder"

0

rename files in a folder python

import os
for dirname in os.listdir("."):
    if os.path.isdir(dirname):
        for i, filename in enumerate(os.listdir(dirname)):
            os.rename(dirname + "/" + filename, dirname + "/" + str(i) + ".bmp")
Posted by: Guest on June-24-2021

Code answers related to "python script to rename all files in folder"

Python Answers by Framework

Browse Popular Code Answers by Language