Discussion:
what's the difference between *.dll and *.pyd if both of them are extended python module?
Daniel Dittmar
2005-08-23 13:33:58 UTC
Permalink
1. what's the difference between them? i saw the code is same as common c++
extended python module, can i use microsoft visual C++ to create a dll
project for compiling it as _cmd.dll?
.pyd is just a naming convention. It was probably introduced to prevent
name clashes with unrelated DLLs.
2. i have never written a module with extension *.pyd, how to make a *.pyd?
and, i doubt, how the author debug the _cmd.pyd, only by Makefile?
I think you can configure the output file name in the project properties.
3. i have a common problem about writting a extend module by c/c++, i often
use msvc to write it, but i only can invoke release dll, not debug dll, even
i use command like this: python_d test.py, in which case, test.py import
test.dll, and invoke test.hello() api. why? anybody has nice way to debug
it? thank you.
Assuming your module is called _cmd:
- add a function init_cmd_d to the extension module (init_cmd_d simply
calls init_cmd)
- import cmd_d in your Python script

I must admit I haven't tried this, it is based on my understanding of
how Python loads extension modules.

Daniel
wen
2005-08-23 13:09:37 UTC
Permalink
i have written python extend module by c/c++, but i saw a module of a
software(pyMOL, you can get it from http://pymol.sourceforge.net/) called
_cmd.pyd instead of _cmd.dll. and it is written by c/c++ also, the author
use makefile to compile it into _cmd.pyd. i have some question about it:
1. what's the difference between them? i saw the code is same as common c++
extended python module, can i use microsoft visual C++ to create a dll
project for compiling it as _cmd.dll?
2. i have never written a module with extension *.pyd, how to make a *.pyd?
and, i doubt, how the author debug the _cmd.pyd, only by Makefile?
3. i have a common problem about writting a extend module by c/c++, i often
use msvc to write it, but i only can invoke release dll, not debug dll, even
i use command like this: python_d test.py, in which case, test.py import
test.dll, and invoke test.hello() api. why? anybody has nice way to debug
it? thank you.


any help would be appreciated.


with my best regards,
Wen

Loading...