Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'e.g.,': 0.07; 'json': 0.07; 'python': 0.08; 'url:pypi': 0.08; 'format?': 0.09; 'received:209.85.160.174': 0.09; 'received:mail- gy0-f174.google.com': 0.09; 'subject:python': 0.11; 'converting': 0.15; 'likewise': 0.16; 'cc:addr:python-list': 0.16; 'wrote:': 0.16; 'cheers,': 0.18; 'convert': 0.19; 'cc:2**0': 0.22; 'header :In-Reply-To:1': 0.22; 'sep': 0.23; 'pm,': 0.24; 'tried': 0.26; 'correct': 0.28; 'message-id:@mail.gmail.com': 0.29; 'cc:addr:python.org': 0.30; 'array': 0.30; 'module': 0.30; 'list:': 0.31; 'url:library': 0.31; 'chris': 0.32; 'list': 0.32; "can't": 0.33; 'idea': 0.34; '2.6': 0.34; 'received:209.85.160': 0.35; 'url:python': 0.36; 'fri,': 0.36; 'but': 0.37; 'received:google.com': 0.38; 'url:org': 0.38; 'received:209.85': 0.38; 'subject:: ': 0.39; 'url:docs': 0.39; 'to:addr:yahoo.com': 0.83; '10:36': 0.84; 'sender:addr:chris': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rebertia.com; s=google; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=AzO5qN/jERZ57Z+sqMjcjIUr2JzP3Axl8wZBIx6PU7E=; b=eq9E5HmhM3V/Pc9r5/A/ua1HfUvdioCOrUh5VTjSN3mCD57lpjZW4RiId6aecbw7l4 VHlP24/EuMvHm0xBApLJyNPcsPTglRo5Q3rRhPfeVRBUEGql1vgPcIAUQ2PwO5HWRn6K MrMbFaGf26ewVVwqp16VZKAhVAPkILCuPfDEQ= MIME-Version: 1.0 Sender: chris@rebertia.com In-Reply-To: <1315028216.36570.YahooMailNeo@web160520.mail.bf1.yahoo.com> References: <1314977665.30984.YahooMailNeo@web160510.mail.bf1.yahoo.com> <1315028216.36570.YahooMailNeo@web160520.mail.bf1.yahoo.com> Date: Fri, 2 Sep 2011 22:50:36 -0700 X-Google-Sender-Auth: z-nCEBEOeeTIKz55c682jelLwMg Subject: Re: json in python 2.5 From: Chris Rebert To: Vineet Deodhar Content-Type: text/plain; charset=UTF-8 Cc: "python-list@python.org" X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1315029041 news.xs4all.nl 2457 [2001:888:2000:d::a6]:33515 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:12692 On Fri, Sep 2, 2011 at 10:36 PM, Vineet Deodhar wrote: >> e.g., I have this list: >> L = ['spam', 'ham', 'eggs', 12, (13.63)] >> What is the correct way to convert L to javascript array format? > Python likewise has a JSON module in the std lib: > http://docs.python.org/library/json.html > ======== > I tried with json in std lib. > But it is included in python 2.6 onwards. > For my current proj, I need to use python 2.5. > Hence can't use json from the std lib. > Any idea on converting list to json in python 2.5? http://pypi.python.org/pypi/simplejson/ Cheers, Chris