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
You don't need to open the files to rename them, os.rename only needs their paths. Also consider using the glob module:
os.rename
import glob, os for filename in glob.iglob(os.path.join(folder, '*.grf')): os.rename(filename, filename[:-4] + '.las')