def downloadFile(url,outfile=None): 
    ''' Copied from  http://stackoverflow.com/questions/16694907/how-to-download-large-file-in-python-with-requests-py '''
    if not outfile:
        outfile = url.split('/')[-1]
    r = requests.get(url, stream=True)
    with open(outfile, 'wb') as f:
        for chunk in r.iter_content(chunk_size=1024): 
            if chunk: 
                f.write(chunk)
    return outfile