Difference between Win-dll's and pyd's??

Christian Tismer tismer at appliedbiometrics.com
Tue May 11 10:52:01 EDT 1999


"Thomas S. Strinnhed" wrote:

> Now for the questions:
>  I suspect the .pyd-files to be "Python-dll's". Right??

Right. They got just a different extension, "python dll".
You can rename them to .dll and inspect them with 
a dll viewer.

>  No:    If not, what are they, and how to use them.
>  Yes:   If so, can I substitute .pyd's for win-dll's and vice versa
>         or can they be used in any other ways??

There is one big difference. .pyd dlls usually export just
one function, which the Python interpreter wants to see:
init<modulename> must be there. Python will call it
once. The .pyd then usually initializes itself, inserts
some objects into its module dictionary and whatever.
So by design, they are usually useless if Python is not
there. 
But you might of course write a standard C .dll which
publishes a number of functions for other C code
and provides an init<modulename> function as well.
This would allow to add a Python interface to your
functions in the same dll file.

ciao - chris

-- 
Christian Tismer             :^)   <mailto:tismer at appliedbiometrics.com>
Applied Biometrics GmbH      :     Have a break! Take a ride on Python's
Kaiserin-Augusta-Allee 101   :    *Starship* http://starship.python.net
10553 Berlin                 :     PGP key -> http://wwwkeys.pgp.net
PGP Fingerprint       E182 71C7 1A9D 66E9 9D15  D3CC D4D7 93E2 1FAE F6DF
     we're tired of banana software - shipped green, ripens at home




More information about the Python-list mailing list