You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import subprocess
from capturer import CaptureOutput
with CaptureOutput() as capturer:
# Generate some output from Python.
print("Output from Python")
# Generate output from a subprocess.
subprocess.call(["echo", "Output from a subprocess"])
# Get the output in each of the supported formats.
assert capturer.get_bytes() == b'Output from Python\r\nOutput from a subprocess\r\n'
assert capturer.get_lines() == [u'Output from Python', u'Output from a subprocess']
assert capturer.get_text() == u'Output from Python\nOutput from a subprocess'
Interpreter just hungs
The text was updated successfully, but these errors were encountered:
This example doesn't work
Interpreter just hungs
The text was updated successfully, but these errors were encountered: