how to reading binary data...

Miki Tebeka miki.tebeka at
Thu Oct 21 10:07:32 CEST 2004

Hello Sandeep,

>    I opened any particular file with the 'rb' mode that is read binary
>    mode. so python will treat the data as a raw data. now i want to read
>    first 4 bytes only then i will convert the first 4 bytes into long
>    datatype and then again read 4 bytes and will do the same.
>    But how to set & move the pointer using loop?
Each time you read from a file the "file pointer" is automatically

>>> f = open(".bashrc")
>>> f.tell()
>>> f.tell()

>    also how to convert into long?

Miki Tebeka <miki.tebeka at>
The only difference between children and adults is the price of the toys

More information about the Python-list mailing list