catching java program return

E

eight02645999

hi

i have to run a java program inside my python script.
i have some java classes declared:
os.environ['CLASSPATH'] = "blah path"

then i used the os.system method to invoke the java program and using
ret = os.WEXITSTATUS(os.system(cmd)) to catch the return

Java gave me an error about unable to locate some classes, and the ret
value is 0. Why is this so? thanks
can anyone advise also on how can i properly catch the correct Java
generated exceptions in the above case. I was thinking i could use
subprocess module, is there a good example of using this module instead
of using os.system? or are they both achieve the same results?

thanks very much for your help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,222
Members
46,810
Latest member
Kassie0918

Latest Threads

Top