I run process.py using command:
try:
result = subprocess.run("python "+filePrefix+"/PythonAbbyy/process.py "+filename+" "+filePrefix+"/out/text/header/"+name+".txt", timeout=6, shell=True)
except subprocess.TimeoutExpired:
error = "Error"
But result returns NOTHING if process did run successfuly and I'm only display "error" when it failed.
What this process return if success and what if failure? How the correct try: except: should look like?
Regards
Comments
2 comments
Hi
I was waiting for an answer for your previous question
- https://forum.ocrsdk.com/thread/executing-in-python-stalls/
until I saw these two new ones.
- https://forum.ocrsdk.com/thread/python-subprocess-run-what-i-should-get-as-a-result/
- https://forum.ocrsdk.com/thread/how-to-use-api/
It should not be that hard after all with Python, please follow these steps:
https://www.ocrsdk.com/documentation/quick-start-guide/python-ocr-sdk/
Then tell me what output you get after step "5"
Or have a look at another sample from ABBYY
- https://pypi.org/project/ABBYY/
- https://github.com/samueltc/ABBYY
Best regards
Koen de Leijer
The problem is that output is not any structured data. So when process ended successfully you have:
But when for instance there is no connection you have:
You have no error handling in process.py
You do NOT return any structured data like JSON or at least XML.
I'm not expert in Python so I ask how to manage it and know if process.py could connect to your service, how to know if completed sucessfully, how to continue next file processing even if timout...(happens often).
Regards
Please sign in to leave a comment.