Created
October 28, 2016 16:28
-
-
Save leonardreidy/d331d183189913be9068afa1284e4b4b to your computer and use it in GitHub Desktop.
Change all file endings in the current folder to .md if they are currently ending in .txt
This file contains 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 | |
folder = os.getcwd(); | |
for filename in os.listdir(folder): | |
infilename = os.path.join(folder,filename) | |
if not os.path.isfile(infilename): continue | |
oldbase = os.path.splitext(filename) | |
newname = infilename.replace('.txt', '.md') | |
output = os.rename(infilename, newname) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment