MS network provider using Python

Chris Liechti cliechti at gmx.net
Wed Oct 31 17:05:59 EST 2001


"John S. Yates, Jr." <john at yates-sheets.org> wrote in 
news:k7o0ut8u8pm4ueoju5djri48ecabjanver at 4ax.com:
> 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 
interpreter.

chris

-- 
Chris <cliechti at gmx.net>




More information about the Python-list mailing list