Answers for "function to create a directory and rename files in it 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 "function to create a directory and rename files in it python"

Python Answers by Framework

Browse Popular Code Answers by Language