[PythonCE] pass Python string to C char *

Adam Walley adam.walley at gmail.com
Wed Aug 20 01:01:34 CEST 2008


Hi, Jared.

Thanks for the tip. I came across c_char_p("mystring"), but have not been
able to get it working. I also attempted a create_string_buffer("mystring"),
but also without success. I have not checked this fully yet, so may still
get it working...

Adam.


On 19/08/2008, Jared Forsyth <jabapyth at gmail.com> wrote:
>
> i believe its ctypes.c_str("mystring"). or maybe its c_char
>
>  On Tue, Aug 19, 2008 at 12:25 PM, Adam Walley <adam.walley at gmail.com>wrote:
>
>>  Hi, All.
>>
>> This question has probably been resolved many times over on various
>> forums, but I was wondering what the best way is to pass a Python string (in
>> my case a file path) to a DLL written in C that expects a char* input?
>>
>> Any suggestions?
>>
>> Adam
>>
>>
>>
>>
>> _______________________________________________
>> PythonCE mailing list
>> PythonCE at python.org
>> http://mail.python.org/mailman/listinfo/pythonce
>>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pythonce/attachments/20080820/63f9a2b9/attachment.htm>


More information about the PythonCE mailing list