Python equivalent of this Curl command
<p>I am trying to download a file using python, imitating the same behavior as this curl command:</p>

<pre><code>curl  ftp://username:password@example.com \
    --retry 999 \
    --retry-max-time 0
    -o 'target.txt' -C -
</code></pre>

<p>How would this look in python ?</p>

<p>Things I have looked into:</p>

<ul>
<li><p>Requests : no ftp support</p></li>
<li><p>Python-wget: no download resume support</p></li>
<li><p>requests-ftp : no download resume support</p></li>
<li><p>fileDownloader : broken(?)</p></li>
</ul>

<p>I am guessing one would need to build this from scratch and go low level with pycurl or urllib2 or something similar.</p>

<p>I am trying to create this script in python and I feel lost..  Should I just call curl from python subprocess ?</p>

<p>Any point to the write direction would be much appreciated</p>

<p>there is this library for downloading files from ftp server</p>

<p><a href="https://pypi.python.org/pypi/fileDownloader.py/0.2.1" rel="nofollow">fileDownloader.py</a></p>

<p>to download the file</p>

<pre><code>downloader = fileDownloader.DownloadFile(âhttp://example.com/file.zipâ, âC:UsersusernameDownloadsnewfilename.zipâ, (âusernameâ,âpasswordâ)) 

downloader.download()
</code></pre>

<p>to resume download</p>

<pre><code>downloader = fileDownloader.DownloadFile(âhttp://example.com/file.zipâ, âC:UsersusernameDownloadsnewfilename.zipâ, (âusernameâ,âpasswordâ)) 

downloader.resume()
</code></pre>

python curl