Skip to content

SupportedPlatforms

Lucas Moura Belo edited this page Sep 23, 2021 · 2 revisions

Supported platforms

The main parts of Python4Delphi are:

  1. PythonEngine.pas
    A collection of relatively low-level routines for communicating with Python, creating Python types in Delphi etc.

  2. VarPyth.pas
    Very high-level and convenient use of Python objects in Delphi using custom variants.

  3. WrapDelphi classes
    Units that allow easy manipulation of standard GUI and other Delphi objects in Python scripts.

Delphi & C++Builder

All the above parts of Python4Delphi are supported under the following platforms:

  • Windows 32 bits
  • Windows 64 bits
  • MacOS (Delphi only)
  • Linux
  • Android

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.

FPC

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://mantis.freepascal.org/view.php?id=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.

Clone this wiki locally