Table of Contents

Class CodeEnvironment

Namespace
Alternet.Common.Python
Assembly
Alternet.Common.Python.v10.dll
public class CodeEnvironment : ICodeEnvironment
Inheritance
CodeEnvironment
Implements

Constructors

CodeEnvironment(IEnumerable<IScriptGlobalItem>, IList<string>, IList<string>, IList<string>, TechnologyEnvironment)

Properties

AssemblyLibPath
GlobalItems
Imports
ModulesSearchPaths
PythonLibNameWithoutExt

Gets or sets the name of the Python library without its file extension. By default, it returns "Python" on Windows and "libpython" on other operating systems.

PythonLibPath
PythonLibPathSuffix

Gets or sets the suffix for the Python library path. By default, it returns "Lib" on Windows and "lib" on other operating systems.

PythonName

Gets or sets Python name. By default returns 'python' on Windows and 'python3' on other operating systems.

PythonNameAndExt

Gets or sets Python name and extension. By default returns 'python.exe' on Windows and 'python3' on other operating systems.

PythonPath
PythonSitePackagesPath
ReferencedAssemblyPaths
References
Technology

Methods

FindPythonDll(string, SearchOption)

Searches for the python library in the specified root folder.

GetPythonConfigVar(string)

Executes 'python' command using os command interpreter and gets the config variable specified by it's name.

GetSystemPythonPath()
RunPythonFileViaApp(string, bool)

Executes a Python script file using the application-defined method for running external commands. This method executes the 'python' command with the specified script file path.

RunPythonScriptViaApp(string, bool)

Executes a Python script using the application-defined method for running external commands. This method executes 'python' command using os command interpreter.

RunPythonScriptViaTempFile(string, bool, Encoding)

Executes a Python script using a temporary file. This method creates a temporary Python script file, writes the script content to it, executes the script, and then deletes the temporary file.