Upload an image file using python
<p>Is there a way of uploading an image file using python ?. Im able to upload files from a simple html page consisting of the code below.But i would like to be able to do that from a python program. Can it be done using urllib2 module ?. Any example i can refer to ?</p>

<p>Please help.
Thank You.</p>

<pre><code>&lt;form action="http://somesite.com/handler.php" method="post" enctype="multipart/form-data"&gt;

&lt;table&gt;

        &lt;tr&gt;&lt;td&gt;File:&lt;/td&gt;&lt;td&gt;&lt;input type="file" name="file" /&gt;&lt;/td&gt;&lt;/tr&gt;

        &lt;tr&gt;&lt;td&gt;&lt;input type="submit" value="Upload" /&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;/table&gt;

&lt;/form&gt;
</code></pre>
