Skip to content

Instantly share code, notes, and snippets.

@iToto
Created August 2, 2013 18:55
Show Gist options
  • Select an option

  • Save iToto/6142418 to your computer and use it in GitHub Desktop.

Select an option

Save iToto/6142418 to your computer and use it in GitHub Desktop.
pandoc convert md to docx in folder
import os
import subprocess
for dirname, dirnames, filenames in os.walk('.'):
for filename in filenames:
if '.md' in filename:
print ("converting file: "+filename+" into: "+filename[:-3]+".docx")
subprocess.call("pandoc "+filename+" -f markdown -t docx -s -o "+filename[:-3]+".docx",stderr=subprocess.STDOUT,shell="true")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment