-
-
Notifications
You must be signed in to change notification settings - Fork 315
SupportedPlatforms
The main parts of Python4Delphi are:
-
PythonEngine.pas
A collection of relatively low-level routines for communicating with Python, creating Python types in Delphi etc. -
VarPyth.pas
Very high-level and convenient use of Python objects in Delphi using custom variants. -
WrapDelphi classes
Units that allow easy manipulation of standard GUI and other Delphi objects in Python scripts.
All the above parts of Python4Delphi are supported under the following platforms:
- Windows 32 bits
- Windows 64 bits
- MacOS (Delphi only)
- Linux
Only Unicode versions of Delphi are supported (Delphi 2009 or later). WrapDelphi uses extended RTTI if available. Also note that, with the exception of TPythonGUIInputOutput which is VCL dependent, the Python4Delphi components are non visual and can be used in Console, VCL or FMX projects.
Delphi Linux and MacOS support was generously sponsored by Laurence Liew from AI Singapore.
All parts of Python4Delphi now work in FPC-Lazarus Win32 and Win64. A serious limitation when using Varpyth is that due to an FPC issue with variants (https://gitlab.com/freepascal.org/fpc/source/-/issues/20849) you will find that there are problems in converting Python Variants to native types and standard variants. As a work-around a new function VarPythonToVariant is introduced for FPC, so that you can write for example:
ShowMessage(VarPythonToVariant(SysModule.version))
instead of
ShowMessage(SysModule.version)
which is possible under Delphi.
The WrapDelphi units have also been ported and Demo31 for Lazarus is included in SVN and works fine. A limitation is that the directive {$METHODINFO} does not exist in FPC, i.e. RTTI information is not produced for methods, and you cannot easily wrap methods. Of course it can be done with a bit of work as you can see in the Wrapxxxx units. Also Extended RTTI is not supported under FPC.
MacOSX and Linux compatibility has not been fully tested. Please test and if required submit a patch.