Re: Byte arrays and DLLs

2022-06-30 Thread Eryk Sun
On 6/30/22, Rob Cliffe via Python-list wrote: > > AKAIK it is not possible to give ctypes a bytearray object and persuade > it to give you a pointer to the actual array data, suitable for passing > to a DLL. You're overlooking the from_buffer() method. For example: >>> ba = bytearray(10)

Byte arrays and DLLs

2022-06-30 Thread Rob Cliffe via Python-list
I have an application in which I wanted a fixed-length "array of bytes" (that's intended as an informal term) where I could read and write individual bytes and slices, and also pass the array to a DLL (one I wrote in C) which expects an "unsigned char *" parameter. I am using ctypes to talk to t

Re: Creating lambdas inside generator expression

2022-06-30 Thread Peter Otten
On 29/06/2022 23:17, Chris Angelico wrote: On Thu, 30 Jun 2022 at 02:49, Johannes Bauer wrote: But now consider what happens when we create the lambdas inside a list comprehension (in my original I used a generator expresison, but the result is the same). Can you guess what happens when we crea