struct.pack_into error
<p>I'm having a problem with read/write binary in python.<br>
I have a binary file that I need to read information, extract a array, modify this array and put these values into file again in same binary format.<br>
I need to use unpack_from and pack_into because sometimes gonna need read/write in the middle of file. </p>

<p>Script: </p>

<pre><code>import struct   
bloco='&gt;%df' %(252)  

#READ 
fa=open('testIN.bin')  
my_array=struct.unpack_from(bloco,fa.read()[0*4:251*4])    
#my_aray has 252 elements array 
#This read is OK! 

#WRITE 
fb=open('testOUT.bin')   
test=struct.pack_into(bloco,fb.write()[0*4:251*4])  
#ERROR in this WRITE 
</code></pre>

<p>Regards, </p>

<p>Ronaldo Palmeira. </p>
