I would like to change the extension of the files in specific folder. i read about this topic in the forum. using does ideas, I have written following code and I expect that
Something like this will rename all files in the executing directory that end in .txt to .text
import os, sys for filename in os.listdir(os.path.dirname(os.path.abspath(__file__))): base_file, ext = os.path.splitext(filename) if ext == ".txt": os.rename(filename, base_file + ".text")