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

Mark Hammond MHammond at skippinet.com.au
Tue May 11 19:23:25 EDT 1999


I feel some of the other responses were _slightly_ misleading.

There are _zero_ differences between the 2 from Python's POV.  When you say
"import foo", a search is done for "foo.pyc", "foo.py", "foo.pyd", or
"foo.dll".

If your Python module is a DLL, it is treated in a fashion identical to
.pyd's.  Windows is _not_ used to search for the DLL when requested by
Python.  Python has no conditional logic based on the 2 extensions.

One of the reasons this was done is to avoid name clashes.  It allows you to
have an existing 3rd party "foo.dll", and have a Python DLL interface to it
as "foo.pyd".  The .pyd will be found before the .dll in the same directory.
If only .DLL was allowed, it would be more difficult to have the 3rd party
DLL named foo as well as your extension DLL named "foo"

Mark.

Thomas S. Strinnhed wrote in message <37382FD9.59EB38C6 at serop.abb.se>...
>Hi
>
>I'm working on Windows NT, MS Developer Studio and are trying to embed
>the Python interpreter in an application.
>
>I also want some C-based modules to be dynamically linked to the
>embedded Python interpreter, as win-dll's.
>
>I'm using "compile.py" by David Ascher to create the MS Dev Studio
>workapsces and projects.
>
>The DLL's work, but some times tiny .pyd-files occur (not always, but
>that can be some set-up stuff).
>
>Now for the questions:
> I suspect the .pyd-files to be "Python-dll's". Right??
> 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??
>
>
>Thanks
> Thomas S. Strinnhed, thstr at serop.abb.se






More information about the Python-list mailing list