Two problems with backslashes

Alex Martelli aleaxit at yahoo.com
Wed Jul 4 10:21:54 EDT 2001


"Gustaf Liljegren" <gustafl at algonet.se> wrote in message
news:Xns90D4A141E71CDgustaflalgonetse at 194.213.69.148...
> I have two problems with backslashes in DOS path strings:
>
> >>> path = 'e:\test\test.txt'

That's e, colon, tab, e, s, tab, e ... each \t is
an escape sequence representing a tab.  You'll need
to double the backslashes or use a rawstring...

> >>> paths = 'e:\test\file1.txt e:\test\file2.txt'

The \f's are form-feeds, I believe.  As above...


Alex






More information about the Python-list mailing list