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


Groups > comp.lang.python > #16419

Re: How convert a list string to a real list

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <alec.taylor6@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.018
X-Spam-Evidence '*H*': 0.96; '*S*': 0.00; 'json': 0.07; 'subject:string': 0.09; 'skip:[ 20': 0.12; 'received:209.85.210.174': 0.13; 'received:mail- iy0-f174.google.com': 0.13; 'from:addr:alec.taylor6': 0.16; 'from:name:alec taylor': 0.16; 'cc:addr:python-list': 0.16; 'convert': 0.19; 'cc:no real name:2**0': 0.20; 'subject:list': 0.21; 'header:In-Reply-To:1': 0.22; 'string': 0.24; 'cc:2**0': 0.24; 'thanks.': 0.26; 'import': 0.27; 'url:mailman': 0.28; 'message-id:@mail.gmail.com': 0.28; 'cc:addr:python.org': 0.29; 'list': 0.32; 'url:listinfo': 0.32; 'subject:How': 0.35; 'url:python': 0.36; 'received:google.com': 0.37; 'received:209.85': 0.38; 'url:org': 0.39; 'received:209': 0.40; '8bit%:100': 0.69; 'charset:gb2312': 0.78; ',and': 0.84; 'skip:\xc7 30': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=fdhRPPpKZFy3UVvpmhi/npfmsbRjGDcF6gcNCgTlHRU=; b=IQnWxQHiDFa6nVkAzBFLCvUGTA5bgoB8Xbl/r/OTQKQ3aJF/c2QW8BBFqG1Q9J5eIr MA5mevAUtdHE1zzpiEqOCb3bYf/jN8AFi6F0SpvO8DV2WW2GW6NBP3usjTZMjGfG/cil isMoN6uX/YrZRESYnBP/S2QjQgcEoQHhTQTGM=
MIME-Version 1.0
In-Reply-To <CAHbqn4jog2CzT+ahL3XwPZwvAr8eKN3qHsp2yaJk1VYa1157JQ@mail.gmail.com>
References <CAHbqn4jog2CzT+ahL3XwPZwvAr8eKN3qHsp2yaJk1VYa1157JQ@mail.gmail.com>
Date Wed, 30 Nov 2011 17:24:59 +1100
Subject Re: How convert a list string to a real list
From Alec Taylor <alec.taylor6@gmail.com>
To 郭军权 <guojunquan@gmail.com>
Content-Type text/plain; charset=GB2312
Content-Transfer-Encoding quoted-printable
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 <python-list.python.org>
List-Unsubscribe <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.3144.1322634302.27778.python-list@python.org> (permalink)
Lines 25
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1322634302 news.xs4all.nl 6893 [2001:888:2000:d::a6]:37280
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:16419

Show key headers only | View raw


import json

s = json.dumps([1, 2, 3, 4])
# '[1, 2, 3, 4]'
l = json.loads(s)
# [1, 2, 3, 4]

2011/11/30 郭军权 <guojunquan@gmail.com>:
> Good after
>     I have a string  liststr = '["aaaa","bbbb","ccc"]' ,and I need convert
> it to a list like list = ["aaaa","bbbb","ccc"],what can id do?
> Thanks.
>
>
> --
> 郭军权
> 清华大学网络中心网络安全实验室
> guojunquan{at}gmail.com
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>

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


Thread

Re: How convert a list string to a real list Alec Taylor <alec.taylor6@gmail.com> - 2011-11-30 17:24 +1100

csiph-web