Re: How to modify the data in a binary file?

2008-07-02 Thread Cédric Lucantis
Le Wednesday 02 July 2008 14:05:39 Jim Brown, vous avez écrit : > Hi all, I'm a Python newbie, so please pardon me if my question may look a > little silly. :) > > I want to modify a binary file p.data (which has some C-style "short" > integers -- 16-bit integers) in such a way: > The bit m and bit

How to modify the data in a binary file?

2008-07-02 Thread Jim Brown
Hi all, I'm a Python newbie, so please pardon me if my question may look a little silly. :) I want to modify a binary file p.data (which has some C-style "short" integers -- 16-bit integers) in such a way: The bit m and bit n of every "short int" si in the file are set to 1, and the left bits in s