Answers for "how to rename all the files in a folder with numbers python"

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 "how to rename all the files in a folder with numbers python"

Python Answers by Framework

Browse Popular Code Answers by Language