Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!goblin1!goblin.stu.neva.ru!uio.no!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: 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; 'subject:Python': 0.06; 'json': 0.07; 'string': 0.09; 'prefixes': 0.09; 'subject:process': 0.09; 'subject:using': 0.09; 'subject:How': 0.10; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'parser.': 0.16; 'string:': 0.16; 'wrote:': 0.18; 'example': 0.22; 'parse': 0.24; 'processor': 0.24; 'sort': 0.25; 'header:In-Reply- To:1': 0.27; 'am,': 0.29; 'returned': 0.30; 'message- id:@mail.gmail.com': 0.30; "i'm": 0.30; 'sep': 0.31; 'but': 0.35; 'received:google.com': 0.35; 'really': 0.36; 'subject:?': 0.36; 'to:addr:python-list': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'needing': 0.65; 'subject:this': 0.83; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=iQQVwvxrGAdeejTJKMojYF9Tz3iuw984f6nt29uacAQ=; b=ylAGXN3q+Yr7e1IDPDXxcCPhRtwpnihFimY4iHA7yJwj0h0X0eVgKUGJb2yHOvf86h LpbfsumsilP7XH4HdQgqGVBS4IHr+cflI9vQPqVRsv3dEq75NxQIbHHMODif33xUGb3Z OXdbFU+bg6EarWQN6nBJS8G0FqYA5xDBKaGNYiidGiWf0pTS5uhex/2kO1Zv8RNAH9RD 9OwUrgg+TOsHYmcE+tf7oIAcLqwlYCfDczIbxtJjZg4itZ02wpxyVHzw0fJJ4pYULCCM AZZtpK99VGLGR+NjrUTStFCvUNig59Z/GjJXBy/xzFMy2oNak8X4rinCCJCYigQfTHx4 cdew== MIME-Version: 1.0 X-Received: by 10.58.152.3 with SMTP id uu3mr15584533veb.16.1377992935251; Sat, 31 Aug 2013 16:48:55 -0700 (PDT) In-Reply-To: <52227FC4.1060208@gmail.com> References: <52227FC4.1060208@gmail.com> Date: Sun, 1 Sep 2013 09:48:55 +1000 Subject: Re: How do I process this using Python? From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 12 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1377992944 news.xs4all.nl 16004 [2001:888:2000:d::a6]:46509 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:53381 On Sun, Sep 1, 2013 at 9:44 AM, Anthony Papillion wrote: > I'm writing a processor for Bitmessage messages and I am needing to > parse the following returned JSON string: > > {u'inboxMessages': Does the JSON string really have those u prefixes and apostrophes? That's not valid JSON. You may be able to use ast.literal_eval() on it - I was able to with the example data - but not a JSON parser. Can you sort out your transmission end? ChrisA