Raw strings as input from File?
tjreedy at udel.edu
Wed Nov 25 00:06:20 CET 2009
> I have a log file with full Windows paths on a line. eg:
> \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 should only happen if you paste the test into your .py file as a
> 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?
Or if you use execfile or compile and ask Python to interprete the input
There are no raw strings, only raw string code literals marked with an
'r' prefix for raw processing of the quoted text.
More information about the Python-list