Python Forum
Python to .so library in Ubuntu for web server - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Python to .so library in Ubuntu for web server (/thread-23293.html)



Python to .so library in Ubuntu for web server - danowitz - Dec-20-2019

Hi - In my project are trying to use python code in a web server. However for various reasons we are not allowed to actually put the python code on the web server itself. The idea that came up is to compile the python code into a shared library that the c++ web server code can call when requested.
To that end, is there a way to compile a python code/project into C++ shared object (.so)? This means providing an "h-file" as well.
If someone knows and could shed light on this, I'd be most grateful :)
Additionally if someone has an additional suggestion other than to compile to a .so - I'd be interested in alternatives as well.

Thanks,
Jeff