 <p>If you want to use pickle you can use the <code>loads</code> and <code>dumps</code> functions.</p> <pre><code>import pickle a_dict = { x:str(x) for x in range(5) } serialized_dict = pickle.dumps(a_dict) # Send it through the socket and on the receiving end: a_dict = pickle.loads(the_received_string) </code></pre> <p>You can also use JSON in a similar fashion. I like JSON because it is human readable and isn't python specific.</p> <pre><code>import json a_dict = { x:str(x) for x in range(5) } serialized_dict = json.dumps(a_dict) # Send it through the socket and on the receiving end: a_dict = json.loads(the_received_string) </code></pre>