MS network provider using Python

Cameron Laird claird at
Thu Nov 1 14:56:52 CET 2001

In article <Xns914C13EEFCD3cliechtigmxnet at>,
Chris Liechti  <cliechti at> wrote:
>"John S. Yates, Jr." <john at> wrote in 
>news:k7o0ut8u8pm4ueoju5djri48ecabjanver at
>> I am prototyping a network provider (a DLL exporting
>> an implementation of the MS defined NP API and invoked
>> by MS's MPR (Multiple Provider Router)).  Since I
>> anticipate a great deal of experimentation I would
>> dearly love to do some prototyping in Python.
>so you want a DLL that is used by an other programm but is itself written 
>in python?
>> Can anyone in this news group offer words of wisdom?
>> What is the best way in this kind of a rapid prototyping
>> environment to expose my python code as a DLL?
>haven't heard of such a tool. py2exe generates standalone python apps, but 
>thats not what you want. wrapping DLLs so that the functions are available 
>in python can be done with SWIG, thats the wrong way in this case.
>if you want to expose some (python coded) functions as a DLL, i think you 
>have to write such a lib yourself. this DLL would then simply call an 
>embedded python interpreter to achieve the function.
>the DLL init function starts the python interpreter and imports your 
>script. all calls to the dll are then maped to a coresponding function in 
>the python script.
>embedding python in C is failrly simple as all what you need to convert 
>python data to c back and forth is provided by the Python DLL. for a 
>documentation of this interface, have a look at "Extending & Embedding" in 
>the Python docs that have come along with your Python distribution.
>the source version of python has also some example code on embedding the 
Another direction one could take this is to write a
COM *service* in Python, using Mark's estimable Win-
specific extensions.  Would that meet the underlying
requirement of this project?  I presume that it's
easy to code a tiny COM-NP gateway.

Cameron Laird <Cameron at>

More information about the Python-list mailing list