Skip to main content

Capture C-level output in context managers

Project description

Context managers for capturing C-level output:

from wurlitzer import capture

with capture() as (stdout, stderr):
    call_c_function()
out = stdout.read()
err = stderr.read()

Project details


Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page