fork download
  1. import json
  2.  
  3. the_json = """
  4. [
  5. {
  6. "ename": "mark",
  7. "url": "Lennon.com"
  8. },
  9. {
  10. "ename": "egg",
  11. "url": "Lennon.com"
  12. }
  13. ]
  14. """
  15. # using del
  16. data = json.loads(the_json)
  17. del data[0]
  18. print(data)
  19.  
  20. # using remove
  21. data = json.loads(the_json)
  22. for item in data:
  23. if item['ename'] == 'mark':
  24. data.remove(item)
  25. break
  26. print(data)
  27.  
Success #stdin #stdout 0.02s 8180KB
stdin
Standard input is empty
stdout
[{u'url': u'Lennon.com', u'ename': u'egg'}]
[{u'url': u'Lennon.com', u'ename': u'egg'}]