how to convert pdf to word using python

Solutions on MaxInterview for how to convert pdf to word using python by the best coders in the world

showing results for - "how to convert pdf to word using python"
Frieda
15 Jan 2016
1# credit to Stack Overflow user in the source link
2# requires LibreOffice installed
3
4import os
5import subprocess
6
7for top, dirs, files in os.walk('/my/pdf/folder'):
8    for filename in files:
9        if filename.endswith('.pdf'):
10            abspath = os.path.join(top, filename)
11            subprocess.call('lowriter --invisible --convert-to doc "{}"' # bash/shell syntax
12                            .format(abspath), shell=True)
13