[Tutor] escaping slashes in filenames..

Sharriff Aina NHYTRO@compuserve.com
Thu, 10 May 2001 05:01:58 -0400


Hi guys!

given:

aa =3D 'c:\ten\ten\ten\ten.jpg
aa2 =3D string.replace(aa, '\t', '\\')  # this results in
'c:\\en\\en\\en\\en.jpg'
aa3 =3D string.replace(aa,'\', '\\\\') # 'c:\\\\en\\\\......

My question is: how do I notify Python that the slashes are part of a
filename and not an escaped character? using r'c:\test'; raw string  is n=
ot
an option because I=B4ve got to take care of a bunch of filenames in a li=
st
or Tuple


Thanks


Sharriff =