Sorry. I can not explain the details because I am not fluent in English.
I have a json document like this:
[
{
"id":"96103252",
"pvname":"Bet365",
}
]
My python code looks like this:
url_odds= cfg.oddsurl
oddsfeed = urllib2.urlopen(url_odds)
oddsjson = json.load(oddsfeed)
getjson = "{""data"":" + oddsjson + "}"
for sport in getjson["data"]:
pv_id= validate(sport,"id")
pv_name= validate(sport,"pv_name")
sql= "INSERT INTO odds_sports(pv_id,pv_name) VALUES ('"
sql= sql+ pv_id + "','"
sql= sql+ pv_name + "')"
cursor.execute(sql)
conn.commit()
It sends this error
getjson = "{""data"":" + oddsjson + "}"
TypeError: cannot concatenate 'str' and 'list' objects