import os file = os.listdir('F:/python/') for i in file: if (i.endswith('.jpg')): os.rename(i,'1.png') print(i)
os.rename (old, new) will be given if there is new.
import os file = os.listdir('F:/python/') for i in file: if (i.endswith('.jpg')): os.rename(i,'1.png') print(i)
os.rename (old, new) will be given if there is new.