problems decoding json objects

Skip Montanaro skip at pobox.com
Wed May 14 06:39:15 EDT 2014


On Wed, May 14, 2014 at 3:36 AM, Tamer Higazi <th982a at googlemail.com> wrote:
> myjs =
> '{"AVName":"Tamer","ANName":"Higazi","AAnschrift":"Bauerngasse","AHausnr":"1","APLZ":"55116","AOrt":"Mainz"},{"KontaktTel":["01234","11223344"],{"ZahlungsArt":"0"},{"ZugangsDaten":["tamer.higazi at nomail.com","mypass"]}'

Following up on Ben's comment, what did you expect? With my Python hat
on, I'd say you've got a string representing a tuple of four
dictionaries, though my human brain can see past the missing '}' which
is supposed to close the second dict. If you add that, it's still not
valid JSON (I guess JSON doesn't have tuples). This stuff isn't meant
to be typed by humans. Instead computers are supposed to barf it out
and munch on it. As Ben indicated, putting it in a string is
pointless. Might as well just define the dictionaries yourself.

not-gonna-mention-eval-ly, y'rs

Skip



More information about the Python-list mailing list