Class PythonExecutor

Constructors

Methods

Constructors

Methods

  • Execute arbitrary Python code.

    Parameters

    • code: string

      The Python code to execute.

    • pythonPath: string = "python"

      The Python executable to use (defaults to "python").

    • withStream: boolean = false

      If true, streams output live to the console (defaults to false).

    • OptionalabortSignal: AbortSignal

      Optional AbortSignal to cancel the execution.

    Returns Promise<ExecutionResult>

  • Execute a Python script file with optional live output streaming.

    Parameters

    • filePath: string

      Path to the Python script.

    • args: string[] = []

      Optional arguments to pass to the script.

    • pythonPath: string = "python"

      The Python executable to use (defaults to "python").

    • withStream: boolean = false

      If true, streams output live to the console (defaults to false).

    • OptionalabortSignal: AbortSignal

      Optional AbortSignal to cancel the execution.

    Returns Promise<ExecutionResult>