Python-充满相同值的dict

Python-充满相同值的dict,python,list,dictionary,multiple-entries,Python,List,Dictionary,Multiple Entries,真的无法摆脱这个。。。 以下是我的python代码: for i in range(len(realjson)) : store["Store"]={ "id" :realjson[i]['id'].strip(), "retailer_id" :RETAILER_ID, "name" :find(realjson[i]["title"],">","<").strip(),

真的无法摆脱这个。。。 以下是我的python代码:

 for i in range(len(realjson)) : 
    store["Store"]={
          "id"          :realjson[i]['id'].strip(),
          "retailer_id" :RETAILER_ID,
          "name"        :find(realjson[i]["title"],">","<").strip(),
          "address"     :realjson[i]["address"].strip(),
          "city"        :realjson[i]["address"].split(",")[-4].strip(),
          "province"    :realjson[i]["address"].split(",")[-3].strip(),
          "group"       :realjson[i]["address"].split(",")[-1].strip(),
          "zip"         :realjson[i]["address"].split(",")[-2].strip(),
          "url"         :"http://blabla.com?id="+realjson[i]["id"].strip(),
          "lat"         :realjson[i]["lat"].strip(),
          "lng"         :realjson[i]["lon"].strip(),
          "phone"       :realjson[i]["telephone_number"].replace("<br />Phone Number: ","").strip()
          }

    stores.append(store)
    print stores[i]
范围内i的
(len(realjson)):
商店[“商店”]={
“id”:realjson[i]['id'].strip(),
“零售商id”:零售商id,

“name”:find(realjson[i][“title”],“>”,“在循环中重用可变对象:

store['Store']
改为在循环中创建新副本:

newstore = store.copy()
newstore['Store'] = { ... }

在循环中重用可变对象:

store['Store']
改为在循环中创建新副本:

newstore = store.copy()
newstore['Store'] = { ... }

在循环中重用可变对象:

store['Store']
改为在循环中创建新副本:

newstore = store.copy()
newstore['Store'] = { ... }

在循环中重用可变对象:

store['Store']
改为在循环中创建新副本:

newstore = store.copy()
newstore['Store'] = { ... }
如果您希望此行仅使用一个键创建新词典,那么您实际需要的是

store = {"Store": { ... }}
如果您希望此行仅使用一个键创建新词典,那么您实际需要的是

store = {"Store": { ... }}
如果您希望此行仅使用一个键创建新词典,那么您实际需要的是

store = {"Store": { ... }}
如果您希望此行仅使用一个键创建新词典,那么您实际需要的是

store = {"Store": { ... }}