Problem to Download ftp file
Gabriel Genellina
gagsl-py2 at yahoo.com.ar
Mon May 7 03:39:36 EDT 2007
En Mon, 07 May 2007 02:27:59 -0300, Shakil Ahmed
<shakil.ahmed at igib.res.in> escribió:
> Actually i need to know that how can i download a ftp file from ncbi by
> using python module ftputil.
>
> import ftputil
>
> host = ftputil.FTPHost('ftp.ncbi.nih.gov/repository/OMIM/morbidmap',
> 'anonymous', 'password')
The "host" is the first part, "ftp.ncbi.nih.gov". The remaining parts are
a directory and a filename. You should write:
host = ftputil.FTPHost('ftp.ncbi.nih.gov','anonymous', 'password')
host.chdir('repository/OMIM')
host.download('morbidmap','path/to/local/file/morbidmap','b')
See the ftputil documentation for more info.
--
Gabriel Genellina
More information about the Python-list
mailing list