Created
December 31, 2014 17:52
-
-
Save vik-y/e0afca85f4df7f33f012 to your computer and use it in GitHub Desktop.
Change extension of all files in a given folder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment