Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # weather_stamp_jpg.py
- import urllib
- import datetime
- def fetchfile(url,nd2=''):
- now = datetime.datetime.now()
- stamp = now.strftime("%Y-%B-%d-%H%M%p")
- file = unicode("c:\\Weather"+stamp+nd2+".jpg")
- try:
- # fetch the image
- urllib.urlretrieve(url, file)
- print "Image received as", file
- except:
- print "Could not fetch file."
- fetchfile('http://www.intellicast.com/WxImages/ForecastWeather/conus_day1.jpg')
- fetchfile('http://images.intellicast.com/WxImages/CurrentTemps/usa.jpg','_temp')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement