473,386 Members | 1,606 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

what's the difference between *.dll and *.pyd if both of them are extended python module?

wen
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
Aug 23 '05 #1
1 2540
wen wrote:
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
Aug 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

220
by: Brandon J. Van Every | last post by:
What's better about Ruby than Python? I'm sure there's something. What is it? This is not a troll. I'm language shopping and I want people's answers. I don't know beans about Ruby or have...
54
by: Brandon J. Van Every | last post by:
I'm realizing I didn't frame my question well. What's ***TOTALLY COMPELLING*** about Ruby over Python? What makes you jump up in your chair and scream "Wow! Ruby has *that*? That is SO...
226
by: Stephen C. Waterbury | last post by:
This seems like it ought to work, according to the description of reduce(), but it doesn't. Is this a bug, or am I missing something? Python 2.3.2 (#1, Oct 20 2003, 01:04:35) on linux2 Type...
7
by: Michele Simionato | last post by:
So far, I have not installed Prothon, nor I have experience with Io, Self or other prototype-based languages. Still, from the discussion on the mailing list, I have got the strong impression that...
92
by: Reed L. O'Brien | last post by:
I see rotor was removed for 2.4 and the docs say use an AES module provided separately... Is there a standard module that works alike or an AES module that works alike but with better encryption?...
31
by: N.Davis | last post by:
I am very new to Python, but have done plenty of development in C++ and Java. One thing I find weird about python is the idea of a module. Why is this needed when there are already the ideas of...
1
by: Carl J. Van Arsdall | last post by:
I'm extending Python with C, it seems as though initialization is easy enough with an init<moduleName>() function that all C extended python modules must provide that can serve as a sort of "module...
21
by: Nikolaus Rath | last post by:
Hello, Can someone explain to me the difference between a type and a class? After reading http://www.cafepy.com/article/python_types_and_objects/ it seems to me that classes and types are...
13
by: Hussein B | last post by:
Hi, I'm familiar with static method concept, but what is the class method? how it does differ from static method? when to use it? -- class M: def method(cls, x): pass method =...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.