PyMemoryModule is a Python binding for MemoryModule.
Project description
PyMemoryModule
PyMemoryModule is a Python binding for MemoryModule.
By this module, you can load DLL completely from memory - without storing on the disk first - all thanks to MemoryModule written by Joachim Bauch.
How to install
pip install pymemorymodule
How to use
import ctypes import pymemorymodule as pymm 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 = ctypes.cast( pymm.MemoryGetProcAddress(handle, "add"), ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_int, ctypes.c_int) ) # Use function exported from DLL assert add(1, 2) == 3 # Free loaded DLL pymm.MemoryFreeLibrary(handle)
How to build and test
python setup.py build_ext -i test
How to run code check
python -m pip install -r requirements-test.txt python -m flake8 --show-source setup.py test.py
How to prepare README.rst
python setup.py md2rst
MemoryModule
License
Mozilla Public License Version 2.0 (MPL2.0)
See also license of MemoryModule: https://github.com/fancycode/MemoryModule/blob/master/LICENSE.txt
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pymemorymodule-0.0.6.tar.gz
(13.4 kB
view hashes)
Built Distributions
Close
Hashes for pymemorymodule-0.0.6-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f4da6b5549e9943522fdaa5d10597eaa5c96db3180c775a6c75250766d57f516 |
|
MD5 | 94b7871e20db1eebd7ff94beaac005e3 |
|
BLAKE2b-256 | 04062e6256db383a0dd93ac3dedacbda1c13c304fc81fee77c1f0abcddc451e9 |
Close
Hashes for pymemorymodule-0.0.6-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 810b2b2f438dca167f3468740a5f5d82e4db961ef8eb17b67c7d5ec34025203d |
|
MD5 | a9a100809d82455c32d74b8fa5cd01c8 |
|
BLAKE2b-256 | a3cb6fa5f9dba2a3032681d9aee4d85cdaf5dd69dc8b90e786bb5bbc352a0a69 |
Close
Hashes for pymemorymodule-0.0.6-cp34-cp34m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5b8e07b4e832303e742074af74548b0f51f3bcc1cb034c68ccee2cda4881973 |
|
MD5 | a90d10be5a778474eeeb8d0efd4374e1 |
|
BLAKE2b-256 | 46e5ecd7c38e1a7cb2ce7570929c9518973b3371d3d82218694e95ba25fb5c13 |
Close
Hashes for pymemorymodule-0.0.6-cp34-cp34m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f914d42e90f9302495c88118907eeec32f48a38525f56ba4c57ab5a008d8b966 |
|
MD5 | 3dec5037fe0578f407233b77158eb461 |
|
BLAKE2b-256 | 5b9b5001c9530737134f2516fe98eb772f9f84f9196d21e6cdf2bd8915749287 |
Close
Hashes for pymemorymodule-0.0.6-cp33-cp33m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47ef86f5efca0ab18f6f69343a55156f2e11bcba2b1086256f5a597208a561d0 |
|
MD5 | 3e6eb52aa83afe0eb32f134ac3fa8017 |
|
BLAKE2b-256 | 475ad1ff0f9ff76a53d1f67426da4e4ce2a7413cc3c7d9272a5b8844c2b67b5e |
Close
Hashes for pymemorymodule-0.0.6-cp33-cp33m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 918c06a5c63c6b2072d29927a9608c97f1db07e45f052d464e68c5c059f802a1 |
|
MD5 | 12dfec3eb9dd0a5b34aafdaca39428a2 |
|
BLAKE2b-256 | 6db83bc7302af043e1c2dd329564b6cf496b362d6335d03a82cd4cb744c8e8f1 |
Close
Hashes for pymemorymodule-0.0.6-cp27-cp27m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8cac0b083f09d3f50f9c7e616b91fc7240fccb540b4abbb0bc3b9afda4260095 |
|
MD5 | 0caf443c471e8cc14294414dc9f2d624 |
|
BLAKE2b-256 | 69b34ef078a557d6d08d9258798f222dd2e20e30283e2c8d5397ea53478a37d4 |
Close
Hashes for pymemorymodule-0.0.6-cp27-cp27m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e92650f64d047577303d5e61553f1240a6880fa04f3a0166bc5071f4871fd36 |
|
MD5 | 680eaf5665244b73e270540a6438040e |
|
BLAKE2b-256 | 994c98792b7d29eb93bf1cf4fde9809b6828d666232e3afb455f9151a767aa4f |