Create ctypes array from a python array Parameters ---------- ctype : ctypes data type data type of the array we want to convert to values : tuple or list data content Returns ------- out : ctypes array Created ctypes array
(ctype, values)
| 86 | |
| 87 | |
| 88 | def c_array(ctype, values): |
| 89 | """Create ctypes array from a python array |
| 90 | |
| 91 | Parameters |
| 92 | ---------- |
| 93 | ctype : ctypes data type |
| 94 | data type of the array we want to convert to |
| 95 | |
| 96 | values : tuple or list |
| 97 | data content |
| 98 | |
| 99 | Returns |
| 100 | ------- |
| 101 | out : ctypes array |
| 102 | Created ctypes array |
| 103 | """ |
| 104 | return (ctype * len(values))(*values) |
| 105 | |
| 106 | |
| 107 | def decorate(func, fwrapped): |
no outgoing calls
no test coverage detected