Basic JSON question: Do I really need the quotes

moogyd at yahoo.co.uk moogyd at yahoo.co.uk
Fri Oct 12 10:09:08 EDT 2012


Hi,
I need to define some configuration in a file that will be manually created.
Internally, the data will be stored as a dict, which contains various properties related to a design
e.g. Design Name, dependencies, lists of files (and associated libraries).
json seemed a quick an easy way of achieving this
Anyway, in simple terms my question - if I know everything is a string, how can I omit the quotation marks?

i.e. I can do

>>> json.loads('{"mykey":["data0", "data1"]}')
{u'mykey': [u'data0', u'data1']}

But I would like to do
>>> json.loads('{mykey:[data0, data1]}')
Traceback (most recent call last):

The problem is that I don't want to make users have to type redundant characters.
Is it possible?
Thanks,
Steven








More information about the Python-list mailing list