I am trying to write json in file by using Json.dump with python 3.X
here is the code :
#write in a file
with open('./mydata/dataleaf.json','w') as outfile:
json.dump(leafdata["data"],outfile)
on my file the outut is :
["{\"Extracts\":[],\"NextPageUrl\":\"\",\"PageCount\":0}", "{\"Extracts\":[],\"NextPageUrl\":\"\",\"PageCount\":0}"]
What I would to get is :
['{"Extracts":[],"NextPageUrl":"","PageCount":0}',
'{"Extracts":[],"NextPageUrl":"","PageCount":0}']
I have tried Eval() but still not working because I am trying to save list of string in file (not a single string) (python json dumps) . Thanks in advance