args in PyArg_ParseTuple

Sylvain Thenault syt at pegasus.logilab.fr
Tue Sep 4 06:28:54 EDT 2001


On Tue, 4 Sep 2001 12:13:31 +0200, lud <lud at sogetek.fr> wrote:
>hello,
>
>i write a module for python and i want to manipulate string with null char
>so, i use (in c)
>PyArg_ParseTuple(args, "s",&myString) // mystring is a char*
>and i get a error message like that :
>    type error argument 1: expected string without null byte, string found
>
 
PyArg_ParseTuple(args, "s#",&myString, &size) // mystring is a char*

size is an integer (length of the string)
    

-- 
Sylvain Thenault

LOGILAB




More information about the Python-list mailing list