pymemorymodule是memorymodule的python绑定。
pymemorymodule的Python项目详细描述
pymemorymodule
pymemorymodule是 MemoryModule。
通过这个模块,您可以完全从内存加载dll 首先存储在磁盘上—这都要感谢 MemoryModule作者 约阿希姆·鲍奇。
如何使用
import pymemorymodule as pymm from ctypes import cast, c_int, CFUNCTYPE with open("path/to/library.dll", "rb") as fp: # Load DLL from bytes object handle = pymm.MemoryLoadLibrary(fp.read()) # __declspec(dllexport) int add(int a, int b) add = cast( pymm.MemoryGetProcAddress(handle, "add"), CFUNCTYPE(c_int, c_int, c_int) ) # Use function exported from DLL assert add(1, 2) == 3 # Free loaded DLL pymm.MemoryFreeLibrary(handle)
如何构建和测试
python setup.py build_ext -i test
如何运行代码检查
python -m pip install flake8 python -m flake8 --show-source setup.py test.py
如何准备readme.rst
python setup.py md2rst