I want to use json
library and run the code
import json
data = ''' {
"name" : "Chuck",
"phone": {
"type" : "intl",
"number" : "+1 734 355 4544"
}
"email" :{
"hide" : "yes"
}
} '''
info = json.load(data)
print 'Name : ', info["name"]
print 'Hide:' , info["email"]["hide"]
It is showing the error "return loads(fp.read(), AttributeError: 'str' object has no attribute 'read' " Any solution for it? Edited version