Editing a Binary File.

Paradox JoeyTaj at netzero.com
Mon Jun 9 02:37:24 EDT 2003


I need to edit a few bytes in an existing binary file. Is this
possible with the Python file object or if not what is another way
that I can accomplish this?
I am running Python 2.2 under Windows.

I have tried using open(fileName, 'a+b') and open(fileName, 'w+b').

With a+ I have not been able to write anywhere but to the end of the
file and with w+ it destroys my file.



                            Thanks Joey.




More information about the Python-list mailing list