CSV module, DictReader problem (bug?)

Tom Plunket tomas at fancy.org
Wed Nov 1 20:17:51 EST 2006


John Machin wrote:

> If you were to write 'c:\temp\book1.csv', it would blow up ... because
> \t -> tab and \b -> backspace. Get into the habit of *always* using raw
> strings r'C:\Temp\Book1.csv' for Windows file names (and re patterns).
> You could use double backslashing 'C:\\Temp\\Book1.csv' but it's
> uglier.

...alternatively you can just use 'unix slashes', e.g.
'c:/temp/book1.csv', since those work just fine 'cause the Windows
APIs deal with them properly.
-tom!



More information about the Python-list mailing list