I think this is my post in DW . I need a help from you guys .
I have a data
, and how i can convert this to ascii ??
Any ideas , please give a hint :)
The values you gave are not really printable characters, but in general ...
c = "%s" % '\x1a' print c
ord() is a built-in function which returns the ASCII value of the passed charachter.
Edit: @ vegaseat:
#python 2.5.2 >>> c="%s" % '\x1a' >>> c '\x1a' >>> print c #nothing gets printed
Like I said ...
>>> c = "%s" % '\x1a' >>> c '\x1a'
>>> c = chr(ord('\x1a')) >>> c '\x1a'
.. since c is not a printable character.
>>> c = "%s" % '\x41' >>> c 'A'