How can I convert a string like '\\x41'
to an escaped string like '\x41'
, using Python?
Asked
Active
Viewed 891 times
0

john_science
- 6,325
- 6
- 43
- 60

Kmd
- 337
- 2
- 5
- 18
-
possible duplicate of [Process escape sequences in a string in Python](http://stackoverflow.com/questions/4020539/process-escape-sequences-in-a-string-in-python) – Josh Lee Apr 01 '11 at 06:24
2 Answers
0
I don't really understand your question, but I'll try to give you some solutions.
- If you gonna print pure '\x41', you could just
print r'\x41'
- And if what you want is to print the 'A' out, pls do:
print u'\x41'

Linmic
- 761
- 4
- 12