How to rebuild a python module/libary [closed]

ぐ巨炮叔叔 提交于 2019-12-13 09:41:24

问题


I'm trying to rebuild the pyhook libary as described in this answer here.

Basically, I need to change a few lines of the C code for the pyhook module.

The problem is I don't know how to access the C code or how to rebuild the libary.

I've heard of Cython but I don't understand it and I don't know how to use it.

Also, I would like the solution to be compatible with py2exe.


回答1:


You need to download the C code first - it's not part of the exe install. Unzip it and you then have a source tree that will build.

To build it you'll need a C compiler. You need to use the SAME ONE as your Python version for your platform. For example, for Windows and Python 3.5 you need the latest Visual C from Microsoft.

For pyHook you also need SWIG. Use that to construct cpyHook_wrap.c from the supplied cpyHook.i

Then run setup.py and you should be good to go.



来源:https://stackoverflow.com/questions/35471744/how-to-rebuild-a-python-module-libary

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!