catching java program return

Discussion in 'Python' started by eight02645999@yahoo.com, Mar 14, 2006.

  1. Guest

    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.
    , Mar 14, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. cesark

    Catching return values of an SP

    cesark, Feb 9, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    473
  2. Guy Robinson
    Replies:
    1
    Views:
    392
    Miki Tebeka
    Nov 30, 2003
  3. Greenhorn
    Replies:
    15
    Views:
    812
    Keith Thompson
    Mar 6, 2005
  4. Eric Lilja
    Replies:
    2
    Views:
    409
    Victor Bazarov
    Apr 8, 2006
  5. Marty
    Replies:
    2
    Views:
    535
    Ben Finney
    Jan 2, 2008
Loading...

Share This Page