Unpacking a python list in C?

Richard P. Muller rpm at wag.caltech.edu
Thu May 2 12:55:00 EDT 2002


I need some help with extending python in C. I want to call a function
of a list from python:

	answer = my_function(my_list)

where my_function is a function, and my_list is a python list of floats.
I want my_function to be a C function, and want to extract my_list into
an integer length and a double * pointing to the values. I spent some
time searching through the extension guide in the docs, but either this
isn't there or I missed the section in which it is discussed. I also
flipped through a few of my python books without luck.

Could some kind soul take pity on me and tell me how to do this? Thanks
in advance...

Rick
-- 
Richard P. Muller, Ph.D. 
rpm at wag.caltech.edu 
http://www.wag.caltech.edu/home/rpm



More information about the Python-list mailing list