Skip to content

Method ExecutePython

Namespace: Belay.Core
Assembly: Belay.Core.dll

ExecutePython(string, CancellationToken)

Executes Python code on the device and returns the raw string output.

csharp
Task<string> ExecutePython(string code, CancellationToken cancellationToken = default)

Parameters

code string

The Python code to execute.

cancellationToken CancellationToken

Cancellation token for the operation.

Returns

Task<string>

The raw string output from the device.

ExecutePython<T>(string, CancellationToken)

Executes Python code on the device and parses the result as the specified type.

csharp
Task<T> ExecutePython<T>(string code, CancellationToken cancellationToken = default)

Parameters

code string

The Python code to execute.

cancellationToken CancellationToken

Cancellation token for the operation.

Returns

Task<T>

The parsed result from the device.

Type Parameters

T

The type to parse the result as.

Released under the Apache License 2.0.