[Tutor] How to convert hex representation of char? (Challenge part 8)
Pieter Lust
pieter.lust at katho.be
Wed May 18 15:04:10 CEST 2005
Hello,
I'm stuck on part 8 of the Python Challenge.
To solve it, I want to feed 2 pieces of data to a Python module. I get
those pieces by reading the webpage source, and then splitting it on
"'", like this:
import urllib
pagesource = urllib.urlopen(site_address).read()
parts = pagesource.split("'")
onepart = parts[1]
anotherpart = parts[3]
onepart and anotherpart contain many hex representations of nonprintable
characters, like '\x14'. But I can't manage to convert those to the
actual nonprintable characters. Any hints on how to do this?
Thanks,
Pieter Lust
More information about the Tutor
mailing list