1

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?

  • There are a boundless number of errors that could come from a python program. If its well written, a non-zero exit code is the basic indicator and other information may be on stderr, stdout or log files. Its like any other program, nothing special about python. – tdelaney Jun 16 '20 at 04:52
  • can I get stderr file to the java programm and inteprete its meaning? I tried ' c=sys.stderr s="%s"%c.errors print("%s"%c.errors)' in python code and I got 98 when I read by java code how to interprete it? – Sandaru Akalanka Jun 16 '20 at 04:56
  • I'm not a java guy. Since this isn't really a python program it may be best to remove python and subprocess tags. Let the java folks focus on it. – tdelaney Jun 16 '20 at 05:13

1 Answers1

0

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

Sri
  • 437
  • 1
  • 4
  • 13