json - Keyerror in python code -



json - Keyerror in python code -

import csv import json,httplib,os connection = httplib.httpsconnection('api.parse.com', 443) connection.connect() connection.request('get', '/1/classes/studentrecord', '',{ "x-parse-application-id": "keys", "x-parse-rest-api-key": "keys", }) result = json.loads(connection.getresponse().read()) varlen=len(result["results"]) open('student_record.csv') f: reader = csv.reader(f, delimiter=' ' , quotechar='|') x in reader: info in x: flag=0 in range(0,varlen): if(result["results"][i]["stufname"]==data[:data.index(',')]): print "value"+str(i) flag=1

m getting keyerror in line

if(result["results"][i]["stufname"]==data[:data.index(',')]): keyerror:"results"

json python-2.7 csv

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -