Harvey Greenberg writes:
> On Saturday, October 5, 2013 7:24:39 PM UTC-6, Tim Chase wrote:
> > >>> s = "[{'a':1, 'b':2}, [1,2,3], 10]"
> > >>> import ast
> > >>> print repr(ast.literal_eval(s))
> > [{'a': 1, 'b': 2}, [1, 2, 3], 10]
>
> that didn't work. printing it looks like the list bec
On Sun, Oct 6, 2013 at 10:27 PM, 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
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
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
On Sun, Oct 6, 2013 at 10:11 PM, Harvey Greenberg wrote:
> On Saturday, October 5, 2013 7:24:39 PM UTC-6, Tim Chase wrote:
>> Python 2.7.3 (default, Jan 2 2013, 13:56:14)
>> [GCC 4.7.2] on linux2
>> Type "help", "copyright", "credits" or "license" for more
>> information.
>> >>> s = "[{
On Sunday, October 6, 2013 10:41:33 AM UTC-6, Harvey Greenberg wrote:
> On Saturday, October 5, 2013 7:24:39 PM UTC-6, Tim Chase wrote:
>
> > On 2013-10-05 18:08, Harvey Greenberg wrote:
>
> >
>
> > > I am looping as for L in file.readlines(), where file is csv.
>
> >
>
> > >
>
> >
>
> >
On Saturday, October 5, 2013 7:24:39 PM UTC-6, Tim Chase wrote:
> On 2013-10-05 18:08, 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 2
On 10/5/2013 9:08 PM, Harvey Greenberg wrote:
I am looping as for L in file.readlines(), where file is csv.
I believe 'for L in file:' does the same, more efficiently, even in 2.7.
--
Terry Jan Reedy
--
https://mail.python.org/mailman/listinfo/python-list
In article ,
Tim Chase wrote:
> sounds like you want ast.literal_eval():
This sounds like a better idea than either of my earlier suggestions!
--
https://mail.python.org/mailman/listinfo/python-list
In article ,
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 i
On 2013-10-05 18:08, 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, whic
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?
--
ht
12 matches
Mail list logo