track_changes_importer.py
Helper script for the track_changes workflow.
import sys, docx
def extract(docx_file, out):
with open(out, 'w', encoding='utf-8') as f:
for p in docx.Document(docx_file).paragraphs:
f.write(''.join([n.text for n in p._element.xpath('.//w:t') if n.text]) + '\n')
if __name__ == '__main__': extract(*sys.argv[1:3])