Package web :: Package web :: Module utils :: Class CaptureStdout
[hide private]
[frames] | no frames]

Class CaptureStdout

source code

Captures everything `func` prints to stdout and returns it instead.

>>> def idiot():
...     print "foo"
>>> capturestdout(idiot)()
'foo\n'

**WARNING:** Not threadsafe!

Instance Methods [hide private]
 
__init__(self, func) source code
 
__call__(self, *args, **keywords) source code