Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.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.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'from:addr:yahoo.co.uk': 0.04; 'subject:file': 0.07; 'lawrence': 0.09; 'parsing': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'worked.': 0.09; 'looping': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'red,': 0.16; 'wrote:': 0.18; 'split': 0.19; 'header:User-Agent:1': 0.23; 'string,': 0.24; 'url:moin': 0.24; 'first,': 0.26; 'post': 0.26; 'header:X -Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; "doesn't": 0.30; 'subject:list': 0.30; 'work.': 0.31; 'url:wiki': 0.31; 'file': 0.32; 'thanks!': 0.32; 'url:python': 0.33; 'subject:from': 0.34; 'convert': 0.35; 'but': 0.35; 'there': 0.35; 'thanks': 0.36; 'url:org': 0.36; 'list': 0.37; 'to:addr:python-list': 0.38; 'list,': 0.38; 'to:addr:python.org': 0.39; 'enough': 0.39; 'received:org': 0.40; 'read': 0.60; '2nd': 0.60; 'most': 0.60; 'first': 0.61; 'kind': 0.63; 'received:2': 0.84; 'subject:read': 0.84; 'items,': 0.91; '2013': 0.98 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: how to read list from file Date: Sun, 06 Oct 2013 18:24:21 +0100 References: <236e2bfa-94a2-4c6b-a6e7-7105370375fc@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: host-2-98-207-126.as13285.net User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.0 In-Reply-To: <236e2bfa-94a2-4c6b-a6e7-7105370375fc@googlegroups.com> 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: 23 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1381080287 news.xs4all.nl 15892 [2001:888:2000:d::a6]:47388 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:56273 On 06/10/2013 17:57, Harvey Greenberg wrote: > On Saturday, October 5, 2013 7:08:08 PM UTC-6, Harvey Greenberg wrote: >> I am looping as for L in file.readlines(), where file is csv. >> >> >> >> L is a list of 3 items, eg, [{'a':1, 'b':2}, [1,2,3], 10] Note that the first item is a dir and 2nd is a list, so parsing with split doesn't work. Is there a way to convert L, which is a string, to the list of 3 items I want? > > Yay!!!! It worked. Thanks! > Very pleased to know, but if you need to post again would you be kind enough to read this first, thanks https://wiki.python.org/moin/GoogleGroupsPython -- Roses are red, Violets are blue, Most poems rhyme, But this one doesn't. Mark Lawrence