The backslash is a key to enter especial characters, like breakline: '\n'
There is two backslashes cause of this especial condition of this char, but if you try print the specific string you will see that only one backslash remain: print alist[2] On 3/12/07, Fabio Gomes <[EMAIL PROTECTED]> wrote:
Hi list, I'm trying to use a string with backslashes in a list. But Python parses strings in lists with repr(). >>> alist = ['a', 'b', 'c:\some\path'] >>> alist ['a', 'b', 'c:\\some\\path'] >>> print alist ['a', 'b', 'c:\\some\\path'] I already tried str() and raw (r) but it didn't work. All I want is to keep a single backslash in the string since it is a path information. Can anyone help me, please? Thank you. ------------------------------ O Windows Live Spaces está aqui! Descubra como é fácil criar seu espaço na Web e sua rede amigos. Confira! <http://spaces.live.com/signup.aspx> -- http://mail.python.org/mailman/listinfo/python-list
-- http://mail.python.org/mailman/listinfo/python-list