2

I am trying to download precipitation data from an ftp server. The code that I am using is this, but am still getting errors.

import urllib2
urlretrieve("http://ftp.cpc.ncep.noaa.gov/fews/fewsdata/africa/arc2/geotiff/", "folder link")
2

Use an ftp library

example for listing data

from ftplib import FTP

host = r'ftp.cpc.ncep.noaa.gov/fews/fewsdata/africa/arc2/geotiff'

#for example
ftp.login("anonymous", "ftplib-example-1")
data = []
ftp.dir(data.append)
ftp.quit()
for line in data:
    print line
| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.