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")

closed as off-topic by PolyGeo Feb 23 '16 at 10:41

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions relating to general Information Technology, with no clear GIS component, are off-topic here, but can be researched/asked at Stack Overflow (software development), Super User (computing hardware and software) and Database Administrators (relational databases)" – PolyGeo
If this question can be reworded to fit the rules in the help center, please edit the question.

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

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