Raw strings as input from File?

MRAB python at mrabarnett.plus.com
Tue Nov 24 15:27:39 EST 2009


utabintarbo wrote:
> I have a log file with full Windows paths on a line. eg:
> K:\A\B\C\10xx\somerandomfilename.ext->/a1/b1/c1/10xx
> \somerandomfilename.ext ; t9999xx; 11/23/2009 15:00:16 ; 1259006416
> 
> As I try to pull in the line and process it, python changes the "\10"
> to a "\x08". This is before I can do anything with it. Is there a way
> to specify that incoming lines (say, when using .readlines() ) should
> be treated as raw strings?
> 
.readlines() doesn't change the "\10" in a file to "\x08" in the string
it returns.

Could you provide some code which shows your problem?



More information about the Python-list mailing list