Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > catching java program return

Reply
Thread Tools

catching java program return

 
 
eight02645999@yahoo.com
Guest
Posts: n/a
 
      03-14-2006
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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Catching external program exceptions Marty Python 2 01-02-2008 12:53 AM
Catching return value in a const reference needed? Eric Lilja C++ 2 04-08-2006 02:59 PM
what value does lack of return or empty "return;" return Greenhorn C Programming 15 03-06-2005 08:19 PM
Catching return values of an SP cesark ASP .Net 2 02-09-2004 03:44 PM
running a dos program and catching the output Guy Robinson Python 1 11-30-2003 12:39 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57