开发者

How to convert ctypes' c_long to Python's int?

开发者 https://www.devze.com 2022-12-21 00:07 出处:网络
int(c_lo开发者_JAVA百科ng(1)) doesn\'t work.>>> ctypes.c_long(1).value 1 Use the \'value\' attribute of c_long object.

int(c_lo开发者_JAVA百科ng(1)) doesn't work.


>>> ctypes.c_long(1).value
1


Use the 'value' attribute of c_long object.


  c_long(1).value

or


  i = c_long(1)
  print i.value


>>> type(ctypes.c_long(1).value)
<type 'int'>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号