On 20/09/2012 5:53pm, David Beazley wrote: > How? I must be missing something very obvious. I would not call it obvious, but you can do >>> m = memoryview(bytearray(5)) >>> ctypes.addressof(ctypes.c_char.from_buffer(m)) 149979304 However, this only works for writable memoryviews. For read-only memoryviews you could do >>> obj = ctypes.py_object(m) >>> address = ctypes.c_void_p() >>> length = ctypes.c_ssize_t() >>> ctypes.pythonapi.PyObject_AsReadBuffer(obj, ctypes.byref(address), ctypes.byref(length)) 0 >>> address, length (c_void_p(149979304), c_long(5))
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4