This sounds like a perfect use of Python - the time taken to expose the
functions to Python should be an investment considering the time you will
spend playing with Python trying to work out how to best use these
functions.

There are 3 choices:
* Use Calldll.
* Use SWIG
* Use manual C code.

The "right" answer will probably depend on the number of functions you need
to expose.  If there are only a small number, the last answer is probably
easiest - by the time you learn how to use SWIG/Calldll, your extension
could already be written.

Calldll and SWIG both have reasonable learning curves, and both have slight
advantages over the other.  Calldll requires no C++ compiler, and handles
simple arguments well.  SWIG allows you to plug in your own custom data
types in a much simpler and Pythonic way.

Mark.

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of John S.
> Yates, Jr.
> Sent: Thursday, 1 November 2001 8:01 AM
> To: [EMAIL PROTECTED]
> Subject: MS network provider using Python
>
>
> I am still in my Python learning stage.  (Not yet ready
> to roll my own implementation :-)
>
> 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.
>
> 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?
>
> The relevant interfaces are not part of win32 so they
> are not supported by Mark Hammond's win32all package.
> This suggests that I need some kind of foreign function
> interface/package/technology.  Should I try to decipher
> CALLDLL?  Is there a better alternative?  (In a past
> life I have been alternatively an assembly language coder
> and a compiler writer.  So mapping function prototypes
> to calling mechanisms and data representations is not
> a stumbling block.)
>
> As I mentioned earlier, I would love to pull this off
> in Python.  But I am willing to be told by those in the
> know that I am really better of sticking to C++...
>
> /john
>
> --
> John Yates
> 40 Pine Street
> Needham, MA 02492
> 781 444-2899
>
> _______________________________________________
> ActivePython mailing list
> [EMAIL PROTECTED]
> http://listserv.ActiveState.com/mailman/listinfo/activepython

_______________________________________________
ActivePython mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activepython

Reply via email to