module io.stdhelper

Short summary

module cpyquickhelper.io.stdhelper

Python wrapper around C functions.

source on GitHub

Functions

function

truncated documentation

capture_output

Catch standard output and error for function function_to_call. If lang is ‘py’, calls capture_output_py()

capture_output_c

Capture the standard output and error for function function_to_call, it wraps C code which catches information …

capture_output_py

Capture the standard output and error for function function_to_call with function redirect_stdout

Documentation

Python wrapper around C functions.

source on GitHub

cpyquickhelper.io.stdhelper.capture_output(function_to_call, lang='py')[source]

Catch standard output and error for function function_to_call. If lang is ‘py’, calls capture_output_py or capture_output_c() if lang is ‘c’.

Parameters

function_to_call – function to call

Returns

output, error

source on GitHub

cpyquickhelper.io.stdhelper.capture_output_c(function_to_call) → Tuple[bytes, Optional[bytes]][source]

Capture the standard output and error for function function_to_call, it wraps C code which catches information from the command line.

Parameters

function_to_call – function to call

Returns

output, error

This function must not be called in parallel with another call of the same function.

Warning

error is always empty. Both streams are merged.

source on GitHub

cpyquickhelper.io.stdhelper.capture_output_py(function_to_call) → Tuple[str, str][source]

Capture the standard output and error for function function_to_call with function redirect_stdout and function redirect_stderr.

Parameters

function_to_call – function to call

Returns

output, error

This function must not be called in parallel with another call of the same function.

Warning

error is always empty. Both streams are merged.

source on GitHub