code: def getfile(url, outdir=None):
      
      fn = os.path.split(url)[-1]
      if outdir is not None:
          fn = os.path.join(outdir, fn)
      if not os.path.exists(fn):
          #Find appropriate urlretrieve for Python 2 and 3
          try:
              from urllib.request import urlretrieve
          except ImportError:
              from urllib import urlretrieve 
          print("Retrieving: %s" % url)
          #Add progress bar
          urlretrieve(url, fn)
      return fn
docs: Function to fetch files using urllib
  
      Works with ftp