Python -- Save Objects Together in a Binary File?
<p>I have a <code>python</code> class that contains many objects -- some are data structures (<code>lists</code>, <code>dicts</code> etc) and some are handlers to other classes (that also contain other data structures...).</p>

<p>Rather than using <code>pickle</code> to save the entire class &amp; its contents, I was wondering if there is a way to <code>serialize</code> the data of <em>several desired objects</em> and save them (ONLY them) in a binary file?</p>

<p>For example, suppose that I have the following 2 python objects:</p>

<pre><code>myList = [1, 2, 3, 4, 5]
myDict = {'a' : 14, 'b' : 5, 'c' : 65}
</code></pre>

<p>What is the best way to save the contents of BOTH of these <code>python</code> objects in a <strong>binary file</strong>? ideally, I'd like to save <em>both objects</em> in the same binary file, and be able to load the data later on.</p>
