Esto es lo q necestas?
>>> print "hola\x"
ValueError: invalid \x escape
>>> print "hola\\x"
hola\x
>>>



El 12 de abril de 2013 12:53, Diego Uribe Gamez <diego.uribe.ga...@gmail.com
> escribió:

> Hola,
>
> quiero escapar el backslash en un string pero me sale un error o me salen
> dos, la idea es que quede así '\x' como hago?
>
> >>> "\\x"
> '\\x'
> >>> r'\x'
> '\\x'
> >>> "\x"
> ValueError: invalid \x escape
>
> --
>   *Diego Alonso Uribe Gamez*
> ------------------------------
>
> *Desarrollador web*
>
> Twitter: @DiegoUG <http://www.twitter.com/DiegoUG>
>
> Google+: http://gplus.to/diegoug
> ------------------------------
>
>
> _______________________________________________
> Python-es mailing list
> Python-es@python.org
> http://mail.python.org/mailman/listinfo/python-es
> FAQ: http://python-es-faq.wikidot.com/
>
>
_______________________________________________
Python-es mailing list
Python-es@python.org
http://mail.python.org/mailman/listinfo/python-es
FAQ: http://python-es-faq.wikidot.com/

Responder a