You can capture sys.stdout if you set it a file object you control in Jython itself. Something like the following would work fine:

sys.stdout = cStringIO.StringIO()
# process
function_to_check_result(sys.stdout.getvalue()) # look at it as a string

This capture is a commonly used pattern in the Jython unit tests, so you might want to look at them to get ideas.

- Jim

On Mon, Jan 19, 2009 at 10:27 AM, josu jugo <> wrote:

I am running a java application which send information to the standard
output under jython. In the console I can see the information but I
want to process it. I don't know if it is possible to caught the
information in a jython string to manipulate it before.

Any suggestion?



This email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
Jython-users mailing list

Jim Baker