Re: Converting a c array to python list

2007-03-04 Thread zefciu
Dennis Lee Bieber wrote: Written properly, all it returns is the address of that array data -- there is no massive copying of data.. I know :) That's why I want to know how to write it properly. zefciu -- http://mail.python.org/mailman/listinfo/python-list

Re: Converting a c array to python list

2007-03-03 Thread zefciu
Russell E. Owen wrote: It might help to have a clearer idea of why you want to do this. I am writing a Mandelbrot fractal generator with Tkinter interface. Now the generation works like this - there is a loop in python which iterates through fractal's pixels and for each of them calls a

Re: Converting a c array to python list

2007-03-02 Thread zefciu
I have just read about buffer and array objects and I think one of them could be fit for my need. However there are two questions. If i make a buffer from a part of dynamically allocated memory, what would free it? Should it be allocated with malloc or some python-specific function? How on

Re: Converting a c array to python list

2007-03-02 Thread Russell E. Owen
In article [EMAIL PROTECTED], zefciu [EMAIL PROTECTED] wrote: Hi! I want to embed a function in my python application, that creates a two-dimensional array of integers and passes it as a list (preferably a list of lists, but that is not necessary, as the python function knows the

Converting a c array to python list

2007-03-01 Thread zefciu
Hi! I want to embed a function in my python application, that creates a two-dimensional array of integers and passes it as a list (preferably a list of lists, but that is not necessary, as the python function knows the dimensions of this array). As I read the reference, I see, that I must first

Re: Converting a c array to python list

2007-03-01 Thread Scott David Daniels
zefciu wrote: Hi! I want to embed a function in my python application, that creates a two-dimensional array of integers and passes it as a list (preferably a list of lists, but that is not necessary, as the python function knows the dimensions of this array). As I read the reference, I