File call error message (double backslash)

M.E.Farmer mefjr75 at hotmail.com
Tue Mar 8 19:01:00 EST 2005


Hello Fred,
Backslashes are used as an escape and not just in Python ( consider
'\r\n' )
To use a backslash you must escape it with two of them like this: \\
'c:\\windows\\dir'
or you can use a raw string:
r"c:\windows\dir"
or you can use forward slashes. Yes that works ;)
"c:/windows/dir"

Windows uses '\' as a path sep but it also understands '/'.
*nix uses '/' as a path sep.

hth,
M.E.Farmer




More information about the Python-list mailing list