Найти - Пользователи
Полная версия: create pyd
Начало » Python для экспертов » create pyd
1
anatoly1712
python 3.4
eсть foo.py
как создать foo.pyd
JOHN_16
Is a *.pyd file the same as a DLL?
Yes, .pyd files are dll’s, but there are a few differences. If you have a DLL named foo.pyd, then it must have a function initfoo(). You can then write Python “import foo”, and Python will search for foo.pyd (as well as foo.py, foo.pyc) and if it finds it, will attempt to call initfoo() to initialize it. You do not link your .exe with foo.lib, as that would cause Windows to require the DLL to be present.

Note that the search path for foo.pyd is PYTHONPATH, not the same as the path that Windows uses to search for foo.dll. Also, foo.pyd need not be present to run your program, whereas if you linked your program with a dll, the dll is required. Of course, foo.pyd is required if you want to say import foo. In a DLL, linkage is declared in the source code with __declspec(dllexport). In a .pyd, linkage is defined in a list of available functions.
Т.о. никак, потому что pyd пишется на С/С++ используя Python API - все это есть в документации.
Alen
anatoly1712
eсть foo.py как создать foo.pyd

Cython / Nuitka /Cx_Freeze .
doza_and
anatoly1712
eсть foo.py
как создать foo.pyd
Вопрос странный. Из него совершенно непонятно зачем.
А поскольку непонятно, предлагаю выполнить в питоне команду:
os.rename("foo.py", "foo.pyd")
Получите то что просили.
Enjoy! :)
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB