How to save the code object in file?
<p>How to save the code object (_ _ code _ _) in file? </p>

<pre><code>&gt;&gt;&gt; c
&lt;code object foo at 0x022E7660, file "&lt;console&gt;", line 1&gt;
&gt;&gt;&gt; pickle.dump(c, f)
Traceback (most recent call last):
  File "&lt;console&gt;", line 1, in &lt;module&gt;
_pickle.PicklingError: Can't pickle &lt;class 'code'&gt;: attribute lookup builtins.code failed
&gt;&gt;&gt; f.write(c)
Traceback (most recent call last):
  File "&lt;console&gt;", line 1, in &lt;module&gt;
TypeError: 'code' does not support the buffer interface
</code></pre>
