portable subprocess with return value and path search

Joshua Levy joshualevy at yahoo.com
Tue Apr 2 16:05:24 EST 2002


I'm trying desperately to get python to do the following
four things at the same time:
    1. Run a subprocess (like "java com.foo.bar arg")
    2. Get the process return value from that subprocess
    3. Work on both Windows and UNIX  (I'll settle for 
          post-Win2000 and Solaris/Linux.)
    4. Resolve the executable, based on the current path.
       (So I only need "java", and not "c:\jdk1.2.2\bin\java",
       in the example above.)
Os.system does not return values from Windows.  The versions of
Os.spawn on Widnows do not resolve executables.
Thanks in advance for any help.

Joshua Levy



More information about the Python-list mailing list