scanf string in python

John Machin sjmachin at lexicon.net
Fri Jul 18 09:13:21 EDT 2003


lehrig <lehrig at t-online.de> wrote in message news:<bf7ut5$vf8$03$1 at news.t-online.com>...
> I have a string which is returned by a C extension.
> 
> mystring = '(1,2,3)'
> 
> HOW can I read the numbers in python ?

That's a very strange C extension, which returns a string that just
happens to look similar to the repr() of a tuple ... What's the name
of the C extension? Where did you get it from? If you are the author,
would you like to be shown how to make it return a tuple? That way,
all the caller has to do is:

x, y, z = my_extn.some_func(.........)




More information about the Python-list mailing list