How to get errors in Python subprocess created by java

177 Views Asked by At

I start the python process by java Runtime.getRuntime().exec("python pythonCode.py") method,

I want to get to know about are there are any errors in python programm and what are those,can i do that?

1

There are 1 best solutions below

0
On BEST ANSWER

Please try the following suggestion

  • Try to write some logs like success.log or failure.log in your python process and after Runtime is ran check if success or failure log is there.
  • If the process is failed parse the failure log to get the root cause.

hope this will help your question