Disclaimer: I am a beginner in python but have Drupal programming experience.
I have this:
f = ['/path/1.jpg', '/path/2.jpg', '/path/3.jpg'] #less than 1500 files
and I need to do this
call(['c:/program files/ABBYY FineReader 10/finereader.exe'] + f)
BUT, there is an argument limit (http://stackoverflow.com/questions/2381241/what-is-the-subprocess-popen-max-length-of-the-args-parameter) of 32K characters, so I need to drop the /path first. How can I proceed, allowing the .exe to locate the files?
Thanks!
You should add
cwd='/path/'into the args of yoursubprocess.call. This will change working directory to'/path/'for the executable (but note it is not used for searching the executable, so still provide your absolute path for that).Then, assuming they are all in that same path, you can use: