Python's driving me mad. Invalid token?

Magnus Lie Hetland mlh at furu.idi.ntnu.no
Sun Oct 20 07:47:59 EDT 2002


In article <3dafb2a6 at news.uia.ac.be>, Paul.Casteels at ua.ac.be wrote:
>It's the line 
>  destFile = open((dirname+"""\"""+name),'w')
>
>\" seems to be treate as one character, r'\' also does not work. 
>You will have to use r'\\'. This is strange, because r'\a' does work as
>expected.

This isn't reall that strange (at least, it's well documented). If
r'\' was allowed, there'd be no way of including a single quote in a
raw, single-quoted string. Right?

>	Paul Casteels

-- 
Magnus Lie Hetland        Practical Python          The Anygui Project
http://hetland.org        http://ppython.com        http://anygui.org



More information about the Python-list mailing list