fork download
  1. my_json = """
  2. {
  3. {obj_id: 123,
  4. location: {
  5. x: 123,
  6. y: 323,
  7. },
  8. {obj_id: 13,
  9. location: {
  10. x: 23,
  11. y: 333,
  12. },
  13. {obj_id: 123,
  14. location: {
  15. x: 122,
  16. y: 133,
  17. },
  18. }
  19. """
  20.  
  21. from json import loads, dumps
  22. print dumps(loads(my_json))
Runtime error #stdin #stdout #stderr 0.09s 8936KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "prog.py", line 22, in <module>
    print dumps(loads(my_json))
  File "/usr/lib/python2.7/json/__init__.py", line 326, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 365, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 381, in raw_decode
    obj, end = self.scan_once(s, idx)
ValueError: Expecting property name: line 3 column 3 (char 5)