binary input and memory address passing

Eric Carlson ecarlson at coe.eng.ua.edu
Wed Dec 13 08:59:30 EST 2006


Thanks Dennis and Scott for both responses. Since Dennis has slam dunked 
my notion of sharing memory addresses (my ignorance in computing is 
pretty much unbounded), I guess I will need to continue on with sharing 
through files.

Opening up and loading the binary info into a string variable is very 
fast. The process bogs when changing the representation to float. So it 
appears that Scott's Block module might do what I need.

My original:

nc = #something given
nr = #something given
f_o=open('junk.bin','rb')
x=reshape(array('d',f_o.read()),(nr,nc))

gives me any array with nr rows and nc columns. Using Block I think I 
would use:

f_o=open('junk.bin','rb')
x = View('d', Block(f_o.read()))

Okay, so now how can I use this? Is this like an array type so that

x = reshape(x,(nr,nc))

makes sense?

Regards,
Eric



More information about the Python-list mailing list