On Thu, Dec 25, 2008 at 10:08 PM, greyw...@gmail.com <greyw...@gmail.com> wrote: > Hi again, > > I've done some more playing around with socket and socketserver and > have discovered I can send strings or lists with socket.send() by > converting to bytes. But lists with strings in them or dicts can't be > converted by bytes(). How can I send those?
If you're sending structured data rather than just bytestrings, you should use proper serialization. Use the `json`, `pickle`, or `marshal` modules to convert your data to an external representation in bytes, send the bytes thru the socket, then deserialize the bytes back into data structures using the same module again. The Python std lib docs are your friend. Merry Christmas, Chris -- Follow the path of the Iguana... http://rebertia.com -- http://mail.python.org/mailman/listinfo/python-list