0

I want to capture the output produced by IPython terminal in a Python terminal. As all the testing takes place using a Python Kernel. I know about the IPython magic function. %%capture Is there a way to use these magic functions as context manager and capture the output, or maybe some other way?

Thanks.

  • "I want to capture the output produced by IPython terminal in a Python terminal." I don't understand what you are trying to achieve exactly. Can you please add more details about what exactly you are doing / trying to accomplish? – juanpa.arrivillaga Nov 26 '18 at 16:40
  • To be concise, something like %%capture cap print abc Captures the stderr but, captures the stderr, while from IPython.utils import capture with capture.capture_output() as cap: print xyz does not capture the error, what am I doing wrong? – Ruchir Garg Nov 27 '18 at 07:05

0 Answers0