strings problem

Dan Bishop danb_83 at yahoo.com
Fri Jul 4 20:54:18 EDT 2003


"Jimmy verma" <jim_938 at hotmail.com> wrote in message news:<mailman.1057340587.28530.python-list at python.org>...
> Hello *.*
> 
> Can you please tell me how can i have the output in no's, instead of string 
> from this program:
>
...
> print t
> 
> The output is
> 
> Token: 50
> Token: 800
> \275\371\264
> 
> Instead of this i want the output should be in no's like this:
> bdF9B4

>>> print repr(t)
'\xbd\xf9\xb4'
>>> print ''.join(['%02X' % ord(c) for c in t])
BDF9B4




More information about the Python-list mailing list