Skip to content

Instantly share code, notes, and snippets.

View fitoprincipe's full-sized avatar
💭
Working in tools for Google Earth Engine.. =)

Rodrigo E. Principe fitoprincipe

💭
Working in tools for Google Earth Engine.. =)
View GitHub Profile
@fitoprincipe
fitoprincipe / so_read_url_write_file.py
Created November 17, 2016 11:48 — forked from hughdbrown/so_read_url_write_file.py
Read from URL, write to file
"""
Code to write data read from a URL to a file
Based on an answer on SO:
http://stackoverflow.com/questions/22676/how-do-i-download-a-file-over-http-using-python/22721
"""
import urllib2
mp3file = urllib2.urlopen("http://www.example.com/songs/mp3.mp3")