I have a lot of code in Delphi I would like to use in python. In Delphi XE is an option to generate C / C + + files. obj Can I generate these files. Obj in Delphi and use it in python code
python code to use it. obj will still be cross-platform?
I have a lot of code in Delphi I would like to use in python. In Delphi XE is an option to generate C / C + + files. obj Can I generate these files. Obj in Delphi and use it in python code
python code to use it. obj will still be cross-platform?
Delphi generated .obj files cannot be consumed by Python because Python doesn't consume .obj files. You'd need to compile them to a library at the very least. At which point, emitting .obj files is pointless – you may as well just output a full module. I conclude that you'll need to compile your Delphi code to a library (DLL) or a COM object.
To support multiple platforms, you'll need to compile separately for each platform. Which means that you'll only be able to support platforms on which Delphi compilers exist. FreePascal has wider platform support and may be a better choice.
Obviously COM would restrict you to Windows. So the other option is a library. This can be consumed using ctypes or by making your module a Python extension module.