Help with pointers when calling from python to C

Nobody nobody at
Sun Oct 10 12:32:45 CEST 2010

On Fri, 08 Oct 2010 18:02:15 +0200, Jonas H. wrote:

> On 10/08/2010 05:23 PM, Carolyn MacLeod wrote:
>> "How do I pass an integer by reference to a C function?"
> That's impossible in pure Python. The only thing I can think of is a 
> wrapper in C.

I didn't see the original message, but if you're using ctypes, create a
c_int value and use byref():

	i = c_int(42)
	print i

More information about the Python-list mailing list