embedding python inC

John Hunter jdhunter at ace.bsd.uchicago.edu
Sun Nov 24 10:40:10 EST 2002


>>>>> "paul" == paul sayuj kanjirathingal <psayuj at rediffmail.com> writes:

    paul> hi, I have a problem. I am using python to read data from
    paul> com port of PC .  the data that i am receiving is stored in
    paul> a List data type.  now I am writing another Program in C to
    paul> manipulate the data.

    paul>    the problem is I want to convert the Python List data
    paul> type to C array data type(char or int); i have embedded the
    paul> python interpreter in C program.

With the little I know about your problem, this sounds more like it
should be an "extending python" question rather than an "embedding
python" question.  Do everything in python, and pass the list off to a
specialized C function for speedy processing (if necessary).  Is this
an alternative for you?  Is there a reason you must do this with
embedding embedding.

>From your description, your list types appear to be simple and
homogeneous (chars or numbers).  In that case, the already built and
super speedy Numeric extension may already do everything you need for
efficiency.

What kinds of processing do you want to do on the data?  With care, it
is possible to handle lists very efficiently with list and dict
built-ins or some widely available extensions like Numeric and
lots-o-others.

    paul> please help me . I have to finish this assignment by this
    paul> month.

More info required.

JDH





More information about the Python-list mailing list