C extensions without using shared libraries

Rolo Tomasi rolo at foobar.org
Wed Sep 5 04:09:34 CEST 2001

On Tue, 4 Sep 2001 19:35:04 -0400 (EDT), Ignacio Vazquez-Abrams <ignacio at openservices.net> wrote:
>On 4 Sep 2001, Rolo Tomasi wrote:
>> Is is possible to create C-based extension modules to Python
>> without using shared libraries?
>Yes, but... why?
>The only way to make a C-based extension for Python static is to link it with
>the Python executable itself. You probably don't want to be doing that.

So are you saying there is a way to make my module a builtin module?
Are there any docs, details on how to do this?

>Or, you could write a C program and embed the Python interpreter in it. That
>way the C program can create modules on its own and then the Python scripts
>can import the modules and then use them.

Is there is a way to import a C-based extension that's not a shared library?
The only thing that I see getting imported are builtin modules, python-code modules
and external language (C, C++, etc.) shared library modules.  I don't have the 
option of using shared libraries, and my extension needs to be written in C 
because of the API it's using.

More information about the Python-list mailing list