backslash plague

Luis P. Mendes luisXX_lupe2XX at netvisaoXX.pt
Fri Oct 22 15:44:35 EDT 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

So, the trick is to put the r in front of the string?!

with the r in front:

x = r'R0\1.2646\1.2649\D'
|>> elements = x.split('\\')
|>> elements
['R0', '1.2646', '1.2649', 'D']  <--what I want


without it:

y='R0\1.2646\1.2649\D'
|>> elements = y.split('\\')
|>> elements
['R0\x01.2646\x01.2649', 'D']  <-- not good


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFBeWMjHn4UHCY8rB8RArvEAJ91mc423u5zY+xYQOLCXoE3ouzb4gCePix/
a745y1s3UMvW61prb6ndCUk=
=pREV
-----END PGP SIGNATURE-----



More information about the Python-list mailing list