vendredi 23 juin 2017

I get an error saying that the if is not correct. Please help me [duplicate]

This question already has an answer here:

from urllib.request import urlopen
import json
import datetime
from datetime import timedelta

t1= datetime.datetime.now()
fn = []
for x in range(0,14):
   t2= t1 - timedelta(days=x)
   t = t2.replace(hour=0, minute=0, second=0, microsecond=0).isoformat()
   url = "url here"+t;
   data = json.load(urlopen(url))
   if len(data) = 0:
      pass
   else:
      fn.append(data)
   x=x+1

Aucun commentaire:

Enregistrer un commentaire