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
execIExecClientsandboxstringscriptstringoptionsPythonExecOptionscancellationTokenCancellationToken
Returns
ExecPythonStreamAsync(IExecClient, string, string, PythonExecOptions?, CancellationToken)
Like ExecPythonAsync(IExecClient, string, string, PythonExecOptions?, CancellationToken) but streams output events as they arrive.
public static IAsyncEnumerable<ExecEvent> ExecPythonStreamAsync(this IExecClient exec, string sandbox, string script, PythonExecOptions? options = null, CancellationToken cancellationToken = default)
Parameters
execIExecClientsandboxstringscriptstringoptionsPythonExecOptionscancellationTokenCancellationToken