Table of Contents

Method RunPythonFileViaApp

Namespace
Alternet.Common.Python
Assembly
Alternet.Common.Python.v10.dll

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.

public static string RunPythonFileViaApp(string pathToScriptFile, bool multiLineResult = false)

Parameters

pathToScriptFile string

The full path to the Python script file to execute.

multiLineResult bool

A boolean value indicating whether the output of the script should be treated as multi-line. If true, the output will include all lines; otherwise, only the first line will be returned.

Returns

string

The output of the Python script as a string, or null if an error occurs during execution.