Kent Johnson wrote:
<snip>
> One way is to paste the string into a program; when Python sees '\x14' it
> creates a string of length 1:
>
> >>> len('\x14')
> 1
>
> Alternately you can use the 'string_escape' codec to convert the string:
> >>> s=r'\x14'
> >>> len(s)
> 4
> >>> t=s.decode('string_escape')
> >>> t
> '\x14'
> >>> len(t)
> 1
>
> Kent
>
Thanks! That solves my problem.
Pieter Lust.
_______________________________________________
Tutor maillist - [email protected]
http://mail.python.org/mailman/listinfo/tutor