0

I'm executing an external command from Jython 2.1 by calling os.system(). This works, but I can't get to any error messages the external program is writing.

Jython 2.1 is too old to use subprocess and os.popen does not seem to exist in Jython 2.1.

How can I capture stderr and stdout of my external program inside my Jython script?

1 Answer 1

2

I have never coded in Jython but as far as I know you can use any java class from Jython code. I am sorry if my suggestion is stupid but why not to call java's ProcessBuilder from your Jython script? ProcessBuilder has this functionality.

1
  • Thanks. My Java knowledge is very limited and hopelessly out of date. I just did not know how to do this effectively in Java. I'll try it out. Dec 8, 2010 at 14:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.