giving garbage value while trying to store a md5 hash in a file in python
<pre><code>m=md5.new() 
a=10111011
&gt;&gt;&gt; m.update(str(a))
&gt;&gt;&gt; k=m.digest()
&gt;&gt;&gt; k
'\xec\x9d1\x89e\x08\xa1\xc2Y\xf6\xbf6\xfe\xe4\xe2M'
&gt;&gt;&gt; f.write(str(k))
&gt;&gt;&gt; f.flush()
</code></pre>

<p>the file f is filled with garbage value which i cant use to read again for further use of the hash . Why does it give the garbage value when on the python terminal it gives proper output?And the worst part is file goes corrupt .. </p>
