Table of Contents

Class ScriptEngine

Namespace
Alternet.Scripter.Python
Assembly
Alternet.Scripter.Python.v10.dll
public class ScriptEngine
Inheritance
ScriptEngine

Constructors

ScriptEngine(IScriptRun)

Fields

RunProcessFunc

Properties

Gil
PythonDllFullName

Gets or sets the full path to the Python DLL file. It includes directory, DLL name and extension.

PythonExePath

Gets or sets the path to the Python executable.

PythonVersion

Gets the version of the Python runtime.

Methods

CoerceBindHandler(Dictionary<string, PyObject>, MethodBase[], ref MethodBase)
Compile(string, string, RunFlagType)
CreateScope()
Execute(CompiledScript, ScriptScope)
Execute(string, ScriptScope, RunFlagType)
ExecuteCode(string, string, ScriptScope)
ExecuteFile(string, ScriptScope)
GetInstalledPackages()

Retrieves a list of installed Python packages in the current environment. This function uses 'importlib.metadata' and operates on third-party distribution packages installed into Python 'site-packages' directory.

InitializeRuntime()
IsErrorOccurred()
IsRuntimeInitialized()
LoadFile(string)
RegisterEncoder(IPyObjectEncoder)

Registers specified encoder (marshaller) from Net object to Python object.

RunCodeInProcess(string)
RunFileInProcess(string, object[], bool)
SetNoSiteFlag()

Set the NoSiteFlag to disable loading the site module. Must be called before initialization.

SetVirtualEnvironment(string)

Configures the Python runtime to use a specified virtual environment. This method modifies the Python system path and prefix to point to the provided virtual environment directory, ensuring that the Python runtime uses the packages and settings from the virtual environment.

ShutDownRuntime()