Answers for "rename files in python windows"

26

python rename file

import os  
os.rename('guru99.txt','career.guru99.txt')
Posted by: Guest on April-01-2020
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

Python Answers by Framework

Browse Popular Code Answers by Language