Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #71543

Re: problems decoding json objects

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <skip.montanaro@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.004
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'json': 0.07; 'string': 0.09; 'comment,': 0.09; 'typed': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; "'}'": 0.16; 'dictionaries': 0.16; 'from:addr:pobox.com': 0.16; 'from:addr:skip': 0.16; 'subject:problems': 0.16; 'tuple': 0.16; 'sender:addr:gmail.com': 0.17; 'wrote:': 0.18; 'wed,': 0.18; 'meant': 0.20; 'putting': 0.22; 'cc:addr:python.org': 0.22; 'skip': 0.24; 'cc:2**0': 0.24; 'define': 0.26; 'second': 0.26; 'header:In-Reply-To:1': 0.27; 'on,': 0.29; 'am,': 0.29; "doesn't": 0.30; 'message- id:@mail.gmail.com': 0.30; 'yourself.': 0.31; 'stuff': 0.32; 'supposed': 0.32; 'guess': 0.33; "i'd": 0.34; 'received:google.com': 0.35; 'add': 0.35; '14,': 0.36; 'representing': 0.36; 'ben': 0.38; 'hat': 0.38; 'that,': 0.38; "you've": 0.63; 'close': 0.67; 'brain': 0.68; 'computers': 0.72; 'dict.': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=bk4gS+drO5MYXRDecWVjwsVD02kF4srbmUUqa/qYa+s=; b=khs6N+Z9TEVOGv3hO3i5c/ON4fpyv9mdIivgLY5fuqGR/IWeeOLbXz+LemboXJYWIe Ks5Fg9/oNseo7ERyhOG9Sl2/RJ1uyNXMLYUZ7Cl/x3ZZdAvmnphkyURc4OxFwYB+35Xk 85Na33GUoPUwN7R7vR1hYKzD1jDDEBiAywUhwH8Th3R9tqPbjoCk6o6fKgueK0rhzt0x 89omxZGfcABmtwPMKv2BOLa+SA89ePkbQe92kSyCUfxyDLSMgglIU2gBUJF8tr67VV9A CiYBQwnUqTydGjuLFevdZUeFouUspF7YuU/HxmWXsvt6VcDaOhxy9FKT7aTBxYJeOE2v ko6A==
MIME-Version 1.0
X-Received by 10.42.109.8 with SMTP id j8mr895914icp.89.1400063956003; Wed, 14 May 2014 03:39:16 -0700 (PDT)
Sender skip.montanaro@gmail.com
In-Reply-To <53732AFB.8080204@googlemail.com>
References <53732AFB.8080204@googlemail.com>
Date Wed, 14 May 2014 05:39:15 -0500
X-Google-Sender-Auth AcQWTwzVkFZTV81L9xDQSk0VjuU
Subject Re: problems decoding json objects
From Skip Montanaro <skip@pobox.com>
To Tamer Higazi <th982a@googlemail.com>
Content-Type text/plain; charset=UTF-8
Cc Python <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.9998.1400063958.18130.python-list@python.org> (permalink)
Lines 16
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1400063958 news.xs4all.nl 2890 [2001:888:2000:d::a6]:60660
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:71543

Show key headers only | View raw


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

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: problems decoding json objects Skip Montanaro <skip@pobox.com> - 2014-05-14 05:39 -0500
  Re: problems decoding json objects Roy Smith <roy@panix.com> - 2014-05-14 07:43 -0400

csiph-web