Published On: 1970-01-01|Last Updated: 1970-01-01|Categories: Uncategorized|
>>> from ctypes import *
>>> class DATA(Structure):
_fields_ = [
('name', c_char_p, ),
]
>>> data = DATA()
>>> data.name = (c_char * 100)()
Traceback (most recent call last):
File "<pyshell#9>", line 1, in <module>
data.name = (c_char * 100)()
TypeError: incompatible types, c_char_Array_100 instance instead of c_char_p instance
>>> data.name = addressof((c_char * 100)())

イケテネェェェェェ

あと http://wiki.python.org/moin/ctypes は必見

でも何でも ctypes から叩こうとするのはやめた方がいいと思います。俺とか

関連