[Tutor] absolute locations

Daniel Ehrenberg littledanehren at yahoo.com
Thu Jan 8 18:49:41 EST 2004


> This means that if you want Python to interpret \
> literally you have
> to use some scheme - hence the doubling \\.
> 
> Hope it helps,
> G. Rodrigues

This can be annoying if you do it alot, so to skip all
of the escape codes and have \ interpreted as \, you
can prefix the string with the letter r. Example:

>>> print 'C:\\new' #annoying, but correct
C:\new
>>> print 'C:\new' #wrong
C:
ew
>>> print r'C:\new' #right and not annoying

Daniel Ehrenberg

__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus



More information about the Tutor mailing list