Skip to main content

Captures stdout

Project description

Captures stdout

pip install capture-stdout-decorator
from capture_stdout_decorator import print_capture

@print_capture

def hahaha():

    print("babab")

    return 4

@print_capture(print_output=False, return_func_val=False)

def hahaha2():

    print("babab")

    return 4

x = hahaha()

print(f'{x=}')

y = hahaha2()

print(f'{y=}')



# output:

babab

x=(4, 'babab\n')

y='babab\n'

		

Project details


Release history Release notifications | RSS feed

This version

0.10

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

capture_stdout_decorator-0.10.tar.gz (3.2 kB view hashes)

Uploaded Source

Built Distribution

capture_stdout_decorator-0.10-py3-none-any.whl (4.6 kB view hashes)

Uploaded Python 3

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