[Tutor] get bytes back from string representation?
Daniel
daniel.chaowang at gmail.com
Mon Apr 13 06:00:35 CEST 2009
hi list,
I am using SUDS to talk with a web service written by C#. The service will
crawl a web page, then return its content as bytes.
it's something like:
>>> from suds.client import Client
>>> url = "http://WSServer/Service1.asmx?wsdl"
>>> client = Client(url)
>>> page = client.service.GetURLContent("http://www.google.cn")
>>> print page
(CrawlResult){
crawStatus = "SUCC"
rawByte = "PGh0bWw+PGhlYWQ+PG1ldGEgaHR0cC1lcXVpdj0iY29udGVudC10eXBlIiBjb2
... "
the problem is I need to convert the rawByte from string to bytes, then
explain it as text with encoding (like "UTF-8").
Any simple way to convert this string back to bytes? I am not clear with
that.
Thanks,
Daniel.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090413/0e549824/attachment.htm>
More information about the Tutor
mailing list