Re: Ah, ctypes

2009-06-02 Thread Lawrence D'Oliveiro
In message slrnh27r80.l3s.n...@irishsea.home.craig-wood.com, Nick Craig- Wood wrote: As a ctypes user I found this an interesting story - thanks for posting it! By the way, I hate wildcard imports. In the ctypes docs, they recommend you do this from ctypes import * but I prefer this:

Ah, ctypes

2009-06-01 Thread Lawrence D'Oliveiro
I wrote some code months ago to output 1-bit-per-pixel PNG files from Python, doing direct calls to libpng using ctypes, because PIL didn't give me sufficient control over colour tables and pixel depths. I thought the code was working fine. I left it aside for some months, came back to it a week

Re: Ah, ctypes

2009-06-01 Thread Nick Craig-Wood
Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote: I wrote some code months ago to output 1-bit-per-pixel PNG files from Python, doing direct calls to libpng using ctypes, because PIL didn't give me sufficient control over colour tables and pixel depths. I thought the code was

Re: Ah, ctypes

2009-06-01 Thread David Bolen
Nick Craig-Wood n...@craig-wood.com writes: ctypes could potentially note that function types don't have enough references to them when passed in as arguments to C functions? It might slow it down microscopically but it would fix this problem. Except that ctypes can't know the lifetime

Re: Ah, ctypes

2009-06-01 Thread Nick Craig-Wood
David Bolen db3l@gmail.com wrote: Nick Craig-Wood n...@craig-wood.com writes: ctypes could potentially note that function types don't have enough references to them when passed in as arguments to C functions? It might slow it down microscopically but it would fix this problem.