Advertisement
Guest User

Untitled

a guest
Feb 27th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. for deviceInDic in devicesDic:
  2. RuntimeError: dictionary changed size during iteration
  3.  
  4. devicesDic = {'duck_waxer' : 0}
  5. x = int(0)
  6. #y = x
  7. y = True
  8. while y == True:
  9. try:
  10. jdata = data["result"]["items"][0]["tagValues"]["IdDevicesMap"]["value"]
  11. for device in jdata.values():
  12. for deviceInDic in devicesDic:
  13. if deviceInDic == device:
  14. devicesDic[device] += 1
  15. else:
  16. print 'else'
  17. devicesDic[device] = 1
  18.  
  19. except KeyError:
  20. #noValues += 1
  21. pass
  22.  
  23. except IndexError:
  24. break
  25. print devicesDic
  26. y = False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement