How to use a contiguous memory location of n bytes in python

chachi ssgosh at gmail.com
Thu Nov 13 19:27:26 EST 2008


Hi,

I want to know how to instantiate a data structure which has n bytes
(given by me) and is internally stored in a contiguous fashion. I know
list is not implemented like this, so I am in a fix. There seems to be
a buffer object available, but haven't seen it being used anywhere.
Does anyone know how to use Buffer? Say I want to write some data onto
the buffer and then write the contents of the entire buffer to a file
(without making a new string, but lets first get the buffer issue out
of the way), how do I do it?



Thanks,
ssg



More information about the Python-list mailing list