now I using json config file to save some settings but after when I write too many data to file I have problem with memory.
Can I read only specific row in file and not whole file?
I rewrite some library from arduino c and want open dict of specific key. See next:
Code: Select all
def begin(self, key, readOnly = True):
self.readOnly = readOnly
if(self.data == None):
with open(self.fileName, 'r') as data_file:
self.data = ujson.loads(data_file.read())
data_file.close()
if(self.data != None):
self.key = key
self.actualData = self.data[key]
if(self.actualData != None):
return True
return False