Andrew Gregory wrote:
Python library functions (prototypes in Python.h, binary library libpython24.a) such as PyComplex_AsCComplex for example must be called for type checking and for conversions to C types at run time. Correct me if I'm wrong, but as far as I know you cannot do that directly from Pascal without quite a lot of work to get Python.h and the many include files within into a Pascal-compatible form. Therefore you have to use C or C++.
If those library routines already exist and are written in C, then sure. And often it may make sense to write small C wrappers indeed -- e.g., I don't know what "CComplex" is -- C has no built-in complex type AFAIK, unlike Pascal, so it may be a user-defined type, and a conversion wrapper may be reasonable. For other types (e.g. `int' -> `CInteger') direct Pascal access to the library routines may be reasonable.
Frank