json load is not correct (python) -


this question has answer here:

when save json ok in file, when load loaded object not correct.

file=open("hello", "w")  a={'name':'jason', 'age':73, 'grade':{ 'computers':97, 'physics':95, 'math':89} }  json.dump(a, file) 

as said in file it's ok when load can see problem.

file:

" {"age": 73, "grade": {"computers": 97, "physics": 95, "math": 89}, "name": "jason"} " 

now load:

b=json.load(file)  print b 

output:

{u"age": 73, u"grade": {u"computers": 97, u"physics": 95, u"math": 89}, u"name": u"jason"}

you can notice before every string there u. it's not effecting code don't there..

why happening?

its in representation ... not there signifying unicode

print u"this" == "this" 

not sure needed own answer:/


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -