[Tutor] help with arrays

Stephen Adler adler at stephenadler.com
Fri May 18 04:26:24 CEST 2007


I'm quite new to python and come from a c++/old school 
math/computing/physics background. My main road block I have right now 
is that I can't for the life of me figure out how to allocate a 1meg 
buffer. (or any arbitrary sized buffer) without using something like the 
range function. It would be nice to do something like


or something like that which would create a string 1000000 characters 
long. And then use that as input into the array module so that I can 
build up an array. What's the standard convention to do this?

Also, how about pointers? I'm using a c++ wrapped in python package 
called vtk and there are some function or class "attributes" which 
return pointers. How do I create a pointer reference?

Thanks. Steve.

More information about the Tutor mailing list