f



What does r"""any text""" mean ?

.... as you can find in os.py at line 1 ?

Regards Alexander
0
8/15/2007 8:15:15 AM
comp.lang.python 77058 articles. 3 followers. Post Follow

2 Replies
481 Views

Similar Articles

[PageSpeed] 40

Alexander Eisenhuth wrote:

> ... as you can find in os.py at line 1 ?

Please don't split your request between subject and body.

String literals enclosed in triple quotes are multiline strings.
String literals prefixed by "r" are raw strings.

http://docs.python.org/ref/strings.html

Regards,


Bj�rn

-- 
BOFH excuse #71:

The file system is full of it

0
8/15/2007 9:11:59 AM
Hi Alexander,

Alexander Eisenhuth wrote:
> ... as you can find in os.py at line 1 ?
This is a raw string. Raw strings don't interpret the escape sequences.
Try this:
>>> print 'a\nb\tc'
a
b       c
>>> print r'a\nb\tc'
a\nb\tc

You needn't use the raw string for printing the backslashes. You can
escape them like this:
>>> print 'a\\nb\\tc'
a\nb\tc


> Regards Alexander
Regards,
Claudio
0
8/15/2007 9:21:26 AM
Reply: