need reading file in binary mode

Sergey P. Vazulia svazulia at centertv.ru
Thu Dec 1 08:37:21 EST 2005


Problem solved.


"Sergey P. Vazulia" <svazulia at centertv.ru> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ
ÓÌÅÄÕÀÝÅÅ: news:dmmtat$all$1 at news.tcnet.ru...
> this part of my code:
>
>         f = file(work_dir + filename,'rb')
                                                       ^
>         n = int(totalSize/recordLenth)
>         i = 0
>         while i < n:
>             buf = f.read(recordLenth);
>
> sometime (when find something like \0A\00\00 in data) returm less bytes
then
> file have.
>
> Q: how-to read all data from binary file with constant_length portions?
>
>





More information about the Python-list mailing list