|
|
|
|
|
PythonAddPath (Function) In french: PythonAjouteChemin Adds the path of a directory or the path of the virtual environment to search for Python modules. Note: 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
sModulePython is string
<IF CibleExécution=Windows>
sModulePython = SysDir(srLocalAppData) + ..
[fSep]+"Programs\Python\Python39\python39.dll"
<ELSE>
<IF CibleExécution=Linux>
sModulePython ="/usr/bin/python/python39.so"
<END>
<END>
IF NOT PythonInitialize(sModulePython) THEN
Error("Echec de l'initialisation de Python", ErrorInfo())
RETURN
END
Info(FonctionPythonImporteeHelloWorld())
IF NOT PythonAddPath(fDataDir()) THEN
Error("Echec de l'initialisation d'un chemin Python", ErrorInfo())
RETURN
END
Info(PythonExecute("fichier_python", "FonctionPythonHelloWorldNonImportee"))
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. Please note: subdirectories are not taken into account.. Business / UI classification: Business Logic
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|