Message270057
I have been happily using this helper function:
def c_array(*args):
if type(args[1]) is int:
ptr, size = args
return (ptr._type_ * size).from_address(ct.addressof(ptr.contents))
else:
c_type, buf = args
return (c_type * (len(buf) // ct.sizeof(c_type))).from_buffer_copy(buf)
For example:
c_array(ptr_obj, 10)
c_array(c_int, bytes_obj) |
|
Date |
User |
Action |
Args |
2016-07-09 17:36:48 | memeplex | set | recipients:
+ memeplex, amaury.forgeotdarc, belopolsky, meador.inge, eryksun |
2016-07-09 17:36:48 | memeplex | set | messageid: <1468085808.33.0.781393471217.issue27274@psf.upfronthosting.co.za> |
2016-07-09 17:36:48 | memeplex | link | issue27274 messages |
2016-07-09 17:36:48 | memeplex | create | |
|