Hi Dear People,
As really beginner in Python, I tried to write a simple script that
opens a binary file and replace all appearance of some data with another
data.
It doesn't show me any error message, but file is not modified. Can you
help to understand why?
My script is as follows:
from array import array
a = array('H')
f = file('project_release.a')
a.fromfile( f,100 )
# update the content
for i in a:
if i == 0xFFFF:
a[ a.index(i) ] = 0x7777
#update to new file
a.tofile(f)
Thanks,
Yitzhak
______________________________________________________________________
DSP Group, Inc. automatically scans all emails and attachments using
MessageLabs Email Security System.
____________________________________________________________________________________________________________________
Python-il mailing list
[email protected]
http://hamakor.org.il/cgi-bin/mailman/listinfo/python-il