|
|
|
|
|
PythonInitialize (Function) In french: PythonInitialise Specifies the location of the Python DLL to be loaded. 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> = PythonInitialize(<DLLÂ location>)
<Result>: Boolean - True if loaded successfully,
- False otherwise.
<DLL location>: Character string Full or relative path of the Python DLL to be loaded. Remarks - The Python DLL must be the same architecture as the application. For example, if the application is executed in 32-bit mode, a 32-bit DLL must be used.
- The DLL version is important: the Python ABI used may change between different Python versions (see Python documentation).. A Python interface compatible with Python 3.9 must be used.
- Manage the errors:
If a problem occurs during loading, a fatal error is generated: unmanaged version, internal Python error, etc.
Related Examples:
|
Training (WINDEV): WD Python
[ + ] This example shows how to run Python code in WINDEV applications. Prerequisite: Python 3 must be installed on the computer. To get Python 3, go to http://legacy.python.org/download/
|
Business / UI classification: Neutral code
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|