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 subprocess | |
import sys | |
def convert(source, from_format, to_format): | |
# original version: http://osiux.com/html-to-restructured-text-in-python-using-pandoc | |
# supported formats at http://johnmacfarlane.net/pandoc/ | |
# raises OSError if pandoc is not found! | |
p = subprocess.Popen(['pandoc', '--from=' + from_format, '--to=' + to_format], | |
stdin=subprocess.PIPE, stdout=subprocess.PIPE | |
) |
NewerOlder