start_output#
- Session.start_output(handle_output=None)#
Start streaming the standard output written by the System Coupling server.
The stdout and stderr streams of the server process are merged into a single stream.
By default, the output text is written to the console, but a custom handler may be specified that deals with it in a different way. For example, the handler might write the output to a file or display it in a separate window. In the default case, printing is done from a separate thread. This may lead to unusual behavior in some Python console environments. In such cases, a custom approach based on the handler might be preferred.
Streaming can be cancelled by calling the end_output() method.
- Parameters:
- handle_output
callable()
,optional
Called with a string argument that provides the latest text in the stream. The text may be assumed to comprise one or more complete lines of text, with no final newline character. The callback should therefore be consistent with a simple call to the
print(text) method
.
- handle_output
- Return type: