[Tutor] convert '\\t' to '\t'

Hy Python pythonpython@hotmail.com
Thu Jan 16 01:17:02 2003


sorry. I confused \ with /
  textstring = textstring.replace('//', '/') is OK, but
  textstring = textstring.replace('\\', '\') does not work.

sorry again.


Hy








>From: "Hy Python" <pythonpython@hotmail.com>
>To: fredm@smartypantsco.com, tutor@python.org
>Subject: Re: [Tutor] convert '\\t' to '\t'
>Date: Thu, 16 Jan 2003 06:05:36 +0000
>
>Thanks for you reply, Fred.
>
>This will not work.
>Python throws out "SyntaxError: invalid token"
>when you try to run textstring = textstring.replace('//', '/')
>
>'/' is not a valid string.
>
>
>Hy
>
>
>
>
>>From: Alfred Milgrom <fredm@smartypantsco.com>
>>To: tutor@python.org,pythonpython@hotmail.com
>>Subject: Re: [Tutor] convert '\\t' to '\t' Date: Thu, 16 Jan 2003 17:00:28 
>>+1100
>>
>> >> Could anyone please give me some tips on converting things like '\\t' 
>>into '\t'?
>>
>>I am not sure that's really your question. If it's just a simple string 
>>substitution, you can use
>>
>>textstring = 'something or other containing //t'
>>textstring = textstring.replace('//', '/')
>>
>>But I suspect you actually want to do something else.
>>Fred Milgrom
>
>
>_________________________________________________________________
>MSN 8 helps eliminate e-mail viruses. Get 2 months FREE* 
>http://join.msn.com/?page=features/virus
>
>
>_______________________________________________
>Tutor maillist  -  Tutor@python.org
>http://mail.python.org/mailman/listinfo/tutor


_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail