I have a dictionary like so:
{
'cost' : cost,
'oLen' : oLen
}
I write this to file so the file contains:
{'oLen': 32, 'cost': 2048}
Later, I do this:
with open('conf.conf') as f:
config = json.loads(f.read())
print config['oLen']
And get this:
ValueError: Expecting property name: line 1 column 2 (char 1)
If I change json.loads to json.dumps, I get:
TypeError: string indices must be integers, not str
