Change extension of all files in a given folder
import os, sys files = os.listdir(os.getcwd()) for f in files: x = f.split('.') r = x[0] + '.extension' #The extension which you want to give to the file os.renames(f, r)