[Tutor] rstrip() failure ?

Danny Yoo dyoo at hkn.eecs.berkeley.edu
Wed Aug 9 23:11:52 CEST 2006


> Is there a way to show the ascii values of the string - kind of hexedit 
> for a string

Try running repr() on the string: it will show an external 
programmer-friendly representation that should be easier to read.  For 
example:

##########################
>>> msg = 'hello\000world'
>>> print repr(msg)
'hello\x00world'
##########################


More information about the Tutor mailing list