the string that contains a file looks like this in the console:
>>> target_file 'src//data//annual_filings//ABB Ltd//ABB_ar_2015.pdf' I got the target_file from a call to os.walk The goal is to build a command to run in subprocess.call Something like:
from subprocess import call cmd_ = r'qpdf-7.0.0/bin/qpdf --password=%s --decrypt %s %s' %('', target_file, target_file) call([cmd_]) I tried different variations, setting shell to either True or False. Replacing the // with /,\ etc. The issue seems to be with the space in the folder (I can not change the folder name).
The python code needs to run on Windows