Commit c6b72fc6 authored by Mattia Bondanza's avatar Mattia Bondanza
Browse files

Prints time and weather for Pisa in the next three days.

import pycurl
import json
from StringIO import StringIO
buffer = StringIO()
c = pycurl.Curl()
c.setopt(c.URL, ',it&APPID=c5ebd88f4494c472f3032e3426b6f0c6')
c.setopt(c.WRITEDATA, buffer)
body = buffer.getvalue()
parsed = json.loads(body)
for i in parsed["list"]:
print i["dt_txt"], " ", i["weather"][0]["description"]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment