I have searched a lot on the Internet, but I haven’t been able to find the solution to send an object over the socket and receive it as is. I know it needs pickling which I have already done. And that converts it to bytes and is received on the other hand. But how can I convert those bytes to
Tag: marshalling
Convert Python ElementTree to string
Whenever I call ElementTree.tostring(e), I get the following error message: Is there any other way to convert an ElementTree object into an XML string? TraceBack: Answer Element objects have no .getroot() method. Drop that call, and the .tostring() call works: You only need to use .getroot() if you have an ElementTree instance. Other notes: This produces a bytestring, which in