import os os.chdir(r"D:\workspace\pandoc-citation-test") print os.getcwd() import pandoc pandoc.PANDOC_PATH = r'C:\Program Files (x86)\Pandoc\bin\pandoc.exe' import os.path os.path.exists(pandoc.PANDOC_PATH) fin = open(r"d:\workspace\msb\pages\pandoc-test.md") text = fin.read() fin.close() print text doc = pandoc.Document() dir(doc) doc.markdown = text print doc.html pandoc.PANDOC_PATH = r'D:\workspace\pandoc-citation-test\Pandoc\bin\pandoc.exe' print pandoc.PANDOC_PATH os.path.exists(pandoc.PANDOC_PATH) pandoc.__file__ print pandoc.PANDOC_PATH def check_if_file_exists_on_path(filename): import sys from os.path import exists if exists(filename): return filename paths = ['pandoc'] paths.extend(sys.path) print paths for p in paths: if exists(p + '/' + filename): return p + '/' + filename raise IOError("File not found on path: %s" % filename) pwd filename = r'd:\library.bib'#'bdb.py'#'Voelkl.pdf' check_if_file_exists_on_path(filename) import re pattern = re.compile('@\w+\d\d\d\d') m=pattern.search("dashjdhaskjdhakjsdhaskj") m csl="chicago-full.csl" csl csl[:-4]+".abbr"