One way would be to create a C or C ++ library that embeds the Python interpreter and runs your Python code.
Another option is to translate Python code in C ++ with ShedSkin and make it a DLL, although I would not expect a very clean API to get out of this.
Martin blech
source share