ctypes: return a pointer to a struct

Jack nospam at invalid.com
Thu Apr 24 23:48:58 EDT 2008


That worked. Thank you!

>> AttributeError: 'LP_IP2LocationRecord' object has no attribute
>> 'country_short'
>
> As it says, LP_IP2LocationRecord has no attribute called
> 'country_short'. IP2LocationRecord does.
>
> Use the 'contents' attribute to dereference the pointer. That is:
>
> yourstruct.contents.country_short





More information about the Python-list mailing list