|
|
|
|
|
PythonAddPath (Function) In french: PythonAjouteChemin Adds the path of a directory or the path of the virtual environment to search for Python modules. Remark: By default, Python modules are searched from the runtime directory. IF PythonInitialize("C:\Programs\Python\Python39\python39.dll") THEN PythonAddPath("C:\tmp\python-modules\") PythonExecute("test_module", "id", 5) END
sPythonModule is string
<IF ExecutionTarget=Windows>
sPythonModule = SysDir(srLocalAppData) + ..
[fSep]+"Programs\Python\Python39\python39.dll"
<ELSE>
<IF ExecutionTarget=Linux>
sPythonModule ="/usr/bin/python/python39.so"
<END>
<END>
IF NOT PythonInitialize(sPythonModule) THEN
Error("Python initialization error", ErrorInfo())
RETURN
END
Info(HelloWorldImportedPythonFunction())
IF NOT PythonAddPath(fDataDir()) THEN
Error("Unable to initialize Python path", ErrorInfo())
RETURN
END
Info(PythonExecute("python_file", "HelloWorldPythonFunctionNotImported"))
PythonTerminate()
Syntax
<Result> = PythonAddPath(<Module path>)
<Result>: Boolean - True if the path has been taken into account,
- False otherwise.
<Module path>: Character string Path where Python modules can be found. Caution: subdirectories are ignored. Business / UI classification: Business Logic
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|