Table of Contents

Class ExecPythonExtensions

Namespace
OpenShell
Assembly
OpenShell.Sdk.dll

Python convenience helpers over IExecClient.

public static class ExecPythonExtensions
Inheritance
ExecPythonExtensions
Inherited Members

Methods

ExecPythonAsync(IExecClient, string, string, PythonExecOptions?, CancellationToken)

Runs a Python source string with python -c and buffers the output. The Python SDK ships a pickled callable instead; .NET code cannot be pickled, so the script is sent as source.

public static ValueTask<ExecResult> ExecPythonAsync(this IExecClient exec, string sandbox, string script, PythonExecOptions? options = null, CancellationToken cancellationToken = default)

Parameters

exec IExecClient
sandbox string
script string
options PythonExecOptions
cancellationToken CancellationToken

Returns

ValueTask<ExecResult>

ExecPythonStreamAsync(IExecClient, string, string, PythonExecOptions?, CancellationToken)

public static IAsyncEnumerable<ExecEvent> ExecPythonStreamAsync(this IExecClient exec, string sandbox, string script, PythonExecOptions? options = null, CancellationToken cancellationToken = default)

Parameters

exec IExecClient
sandbox string
script string
options PythonExecOptions
cancellationToken CancellationToken

Returns

IAsyncEnumerable<ExecEvent>