I am new to python and ctypes. I am trying to complete a seemingly easy task, but getting unexpected results. I am trying to pass a string to a c function, so I am using type c_char_p, but this gives me an error message. Simple, this is what happens:
>>>from ctypes import * >>>c_char_p("hello world") Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: string or integer address expected instead of str instance
What's going on here?
python ctypes
Brandon yates
source share