capture

How to capture stdout output from a Python function call?

How to capture stdout output from a Python function call? Question: I’m using a Python library that does something to an object do_something(my_object) and changes it. While doing so, it prints some statistics to stdout, and I’d like to get a grip on this information. The proper solution would be to change do_something() to return …

Total answers: 5