tags:

views:

125

answers:

3

int(c_long(1)) doesn't work.

+4  A: 
>>> ctypes.c_long(1).value
1
gnibbler
+1  A: 
>>> type(ctypes.c_long(1).value)
<type 'int'>
Ignacio Vazquez-Abrams
+2  A: 

Use the 'value' attribute of c_long object.


  c_long(1).value

or


  i = c_long(1)
  print i.value

N 1.1