Python C扩展名:使用扩展名PYD还是DLL? [英] Python C extension: Use extension PYD or DLL?

查看:418
本文介绍了Python C扩展名:使用扩展名PYD还是DLL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用C编写的Python扩展名,我想知道我是否应该在Windows下使用文件扩展名DLL或PYD. (我将在Linux中使用什么?)

I have a Python extension written in C and I wonder if I should use the file extension DLL or PYD under Windows. (And what would I use in Linux?)

除了文件名以外,有什么区别吗?

Are there any differences (besides the filename)?

我发现一篇非正式文章.这是pyc的秘密吗? 为什么找不到有关此主题的任何官方文章?

I found an unofficial article. Is this the secret of pyc? Why can't I find any official article on this topic?

推荐答案

pyd文件只是准备用于python导入的dll文件.

pyd files are just dll files ready for python importing.

要将它们与普通dll区别开,我建议在Windows中使用.pyd而不是.dll.

To distinguish them from normal dlls, I recommend .pyd not .dll in windows.

这是有关此问题的官方文档:

Here is the official doc about this issue:

http://docs.python.org/faq/windows.html#is-a-pyd-file-the-same-as-a-dll

这篇关于Python C扩展名:使用扩展名PYD还是DLL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆