Rename Multiple File

import os

Folderpath='E:/Old Laptop/Notice/Art Class/Images'
def rename(Folderpath,NewName,Number,Extension):
    list=os.listdir(Folderpath)
    os.chdir(Folderpath)
    Number=0
    for i in list:
        os.rename(i,NewName+str(Number)+'.'+Extension)
        Number=Number+1
rename(Folderpath,'Image ',1,'jpg')
print("File Renamed Successfully!")   


If you have any doubts, feel free to post it in comment Section.



Comments

Popular posts from this blog

Guessing the Number Game

Find the final amount after Discount

Simple Arithmetic Calculator - User Defined Function