Jep *and* Python newbie here; pardon if this is an odd question:
I'm trying to capture stdout from Jep from within a Java program. I've successfully used JepConfig().setRedirectOutputStreams(true) and see, for instance "hi" in IntelliJ's debug console when I exec("print("hi")").
But when I try to grab Java's stdout stream so I can get that output by doing this:
ByteArrayOutputStream pipeOut = new ByteArrayOutputStream();
System.setOut(new PrintStream(pipeOut));
it stops displaying "hi" in the console, but never gets it into pipeOut.
Am I doing something wrong? Or (better) is there a more direct way to receive stdout (& stderr) in a Java program running Python through Jep?
Thanks!
Brad