|
Burgerlib Python
|
Handy class for capturing stdout from tools and python itself. More...


Public Member Functions | |
| __init__ (self) | |
| Declares the internal variables. | |
| __enter__ (self) | |
| Invoked on "with" which intercepts all future stdout. | |
| __exit__ (self, *args) | |
| Disconnect the stdout and store the items into a list of lines. | |
Protected Attributes | |
| _stdout = None | |
| Saved copy of sys.stdout. | |
| _stringio = None | |
| StringIO to redirect output to. | |
Handy class for capturing stdout from tools and python itself.
Examples
with Interceptstdout() as output: do_somethingthatprints()
| burger.Interceptstdout.__exit__ | ( | self, | |
| * | args ) |
Disconnect the stdout and store the items into a list of lines.
Using splitlines(), output the buffer into a list of lines into the output field.