Answers for "python rename all file in a directory"

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 rename all file in a directory"

Python Answers by Framework

Browse Popular Code Answers by Language