from string to raw string

Dan Perl danperl at rogers.com
Mon Dec 13 23:46:45 EST 2004


Yeah, you're right.  I got it all twisted in my mind.  It's late and I must 
be getting tired.

Thanks.

Dan

"Brian Beck" <exogen at gmail.com> wrote in message 
news:cplqc9$4rj$1 at eeyore.INS.cwru.edu...
> Dan Perl wrote:
>> Is there a way to convert a regular string to a raw string so that one 
>> could get from '\bblah' to r'\bblah' other than parsing the string and 
>> modifying the escapes?
>
> There's no such thing as a raw string, only raw string literals. In other 
> words, it's a syntax to tell the Python interpreter which characters in 
> your string are 'special' and has no effect on strings not input as 
> literals directly within your code.  Strings from files or any input 
> besides the interactive Python shell will already be what you're looking 
> for.
>
> -- 
> Brian Beck
> Adventurer of the First Order 





More information about the Python-list mailing list