Ok , let say that I have a string text file named \"string.txt\" , and I want to convert it into a json text file. What I suppose to do? I have tried to use \'json.loads()\' ,bu
In this case You need to read the content of file
obj, end = self.raw_decode(s, idx=_w(s, 0).end()) TypeError: expected string or buffer
import json f = open("string.txt", 'w') f1 = open("stringJson.txt", 'r') data = json.loads(f1) f.write(json.dumps(data, indent=1)) f.close()