Pythonic gui format?

DH no at spam.com
Tue Feb 14 21:16:15 EST 2006


bruno at modulix wrote:
> DH wrote:
>> bruno at modulix wrote:
>>
>>> DH wrote:
>>>
>>>> Bruno Desthuilliers wrote:
>>>>
>>>>>> I am currently seeking for pythonic alternative for XML. 
>>>>>
>>>>> A pretty obvious one is dicts and lists. What about (Q&D):
>>>>
>>>> That's like JSON: http://www.json.org/example.html
>>>
>>> No, it's pure Python. It happens that JSON looks pretty close to Python,
>>> but that's another point.
>>
>> Python dict and lists ARE JSON.  The only difference that python can't
>> handle is multiline comments.
> 
> And what about true vs True and false vs False ?-)

The syntax is the same, except for, as I said, JSON's multiline comments.
The semantics do differ, but that has nothing to do with the user's
question, about an alternative to XML for data representation.  You
can use "true" or True or "null" or None or whatever semantic values
you want.

You can use the JSON library if you want.  But there really is no
need in this case.  Just import the file containing the dicts and lists.

> No, Python's dicts and lists are not JSON. 

Which are syntactically identical to JSON's.

 > They are Python's dicts and
> lists. JSON stands for JavaScript Object Notation, and AFAIK, Python and
> javascript are two different languages

No shit.



More information about the Python-list mailing list