Raw Strings!

Magnus L. Hetland mlh at idt.ntnu.no
Sat Jun 12 12:18:07 EDT 1999


"'Gerrit Holl" <gerrit at nl.linux.org>, '@humbolt.nl.linux.org writes:

> On Sat, Jun 12, 1999 at 10:30:16AM -0500, SunitJoshi wrote:
[...]
> > 
> > Hi All
> >         If someone could show me how to use raw-strings with variables, I
> > would really appreciate it.
> >         For e.g.: if str_path = "C:\\windows\\temp"
> > 
> 
> var = r"D:\\stupid\\windows\\path"
> 
> note the "r" of "raw" before the string. This is always the case.

I don't think this is what is wanted here... Try

  r"C:\windows\temp"

instead. The point with raw strings is that backslashes can be written
out without being escaped.

> 
> 9 minutes and i reply... hmm, not bad :-)

Well - not too good either, considering that you gave a misleading
answer <wink>

> 
> regards,
> Gerrit.
> 
> 

--

  Magnus              Making no sound / Yet smouldering with passion
  Lie          The firefly is still sadder / Than the moaning insect
  Hetland                                       : Minamoto Shigeyuki




More information about the Python-list mailing list