Skip to content Skip to sidebar Skip to footer

Conitnue To Read Through Nul

I got a .dat file, encoded in ANSI which contains NUL caracters (not only !). I wan't to read it into a str object iot cut something in the whole str obtained. But file.read() stop

Solution 1:

If you want to read bytes like 0, chances are your file is a binary file. Read in binary mode rb instead of text mode rt.

Solution 2:

As Evert has commented in my question, the problem was focused on the use of Pyscripter ! So, this question is closed :)

Post a Comment for "Conitnue To Read Through Nul"