In a python2.7 script, I'm using subprocess.call to run a java program like this:
java_command = "java -jar /path/to/java_program.jar %s %s >> %s" % (infile, outfile, logfile)
subprocess.call(java_command, shell=True)
...
#Do other stuff unrelated to this output
Most of the time, this works fine, but in some cases the java program errs:
Exception in thread "main" java.lang.NullPointerException
at MyProgram.MainWindow.setProcessing(MainWindow.java:288)
The problem is that my python script is then stalled on the subprocess.call() line and can't do the "other stuff".
Is there a way I can edit either the java_command I'm using or the way I'm using subprocess to continue the python script even when the java program hangs?
Note that I can't modify the java program's code.