Problem with a tuple - newbie ignorance

Grant Edwards grante at visi.com
Tue Jan 16 13:23:15 EST 2001


In article <slrn968fk9.g0f.scarblac at pino.selwerd.nl>, Remco Gerlich wrote:
>Alan Daniels <danielsatalandanielsdotcom> wrote in comp.lang.python:
>
>> 3) If you find yourself doing the double-backslash a lot (thanks,
>> Microsoft!), rather than typing...
>> > dir = os.listdir('D:\\statlab\\ssda\\data')
>> ...you can write this as...
>> 
>>   dir = os.listdir(r'D:\statlab\ssda\data')
>
>Also, a / works just as well:
>
>dir = os.listdir('D:/statlab/ssda/data')
>
>It works, but it's kind of secret, it seems :)

Apparently.  Forward slashes have been accepted by MS
"operating systems" since the very beginning, but I don't know
how many times I've seen people (mostly in C programs) shooting
themselves in the foot by trying to use backslashes instead.

-- 
Grant Edwards                   grante             Yow!  I want to so HAPPY,
                                  at               the VEINS in my neck STAND
                               visi.com            OUT!!



More information about the Python-list mailing list