[fpc-pascal] Python interaction... how?

Michael Van Canneyt michael at freepascal.org
Fri Feb 16 09:59:41 CET 2018



On Fri, 16 Feb 2018, leledumbo via fpc-pascal wrote:

>> Does anyone know of a minimal example or pseudo code or just an
> explanation?
>
> Python actually provides a Python.h that you can convert to a Pascal unit.
> But inside, it includes a bunch of other header files and conversion might
> be a tedious task. If you made it, though, simply call:
>
> Py_Initialize();
> Py_WhateverThereAreMultipleChoicesHere(ProbablyAPythonScriptAsCString);
> Py_Finalize();
>
> and you're done.

This task has been done for you. See:

http://wiki.freepascal.org/Python4Delphi

Michael.



More information about the fpc-pascal mailing list