My Projects
5. File Renamer Program
import os
supported_file = ".png"
def file_renamer():
f_path = input('enter path of file: '.title())
f_path=f_path.replace('\\','/')
f_path=f_path+'/'
i=1
for file in os.listdir(f_path):
n_name = f_path+str(i)+supported_file
o_name = f_path+file
os.rename(o_name,n_name)
i+=1
file_renamer()
Comments
Post a Comment