Embedding Python in C

dieter dieter at handshake.de
Sat Jul 20 00:33:53 EDT 2019


Jesse Ibarra <jesse.ibarra.1996 at gmail.com> writes:
> ...
> Now ,I need to bring in shared libraries using C/Python API using Smalltalk. It seems like I can't directly bring in C shared libraries (.so files). PROBLEM.

With Python, you typically do not load ("bring in") shared libraries
explicitly; instead, you simply import a module; should this module
be implemented by a shared library, it will be loaded implicitly.

Thus, once you are in the Python world, shared libraries are no
longer a problem. You told us that you already know how to
build shared libraries and call them from Smalltalk.
Thus, do this: ensure that the activated shared library initializes
the [C]Python runtime (Stefan posted a link for this), use
"Cython" to interface Python with C.





More information about the Python-list mailing list