Re: turn text lines into a list

2005-06-28 Thread Big and Blue
Gunnar Hjalmarsson wrote: > >> @corenames=qw( >> rb_basic_islamic >> sq1_pentagonTile >> sq_arc501Tile >> sq_arc503Tile >> ); > > > Impractical to mix code and data, isn't it? Obviously not impractical, given he did it quite easily and succinctly. > chomp( my @corenames = ); > > __DATA__

Re: turn text lines into a list

2005-06-27 Thread Bengt Richter
On 27 Jun 2005 16:56:34 GMT, "F. Petitjean" <[EMAIL PROTECTED]> wrote: >[En-tête "Followup-To:" positionné à comp.lang.python.] >Le Mon, 27 Jun 2005 14:27:28 -, Grant Edwards a écrit : >> On 2005-06-27, Xah Lee <[EMAIL PROTECTED]> wrote: >>> i have a large number of lines i want to turn into a

Re: turn text lines into a list

2005-06-27 Thread F. Petitjean
[En-tête "Followup-To:" positionné à comp.lang.python.] Le Mon, 27 Jun 2005 14:27:28 -, Grant Edwards a écrit : > On 2005-06-27, Xah Lee <[EMAIL PROTECTED]> wrote: >> i have a large number of lines i want to turn into a list. >> In perl, i can do >> >> @corenames=qw( >> rb_basic_islamic >> sq1_

Re: turn text lines into a list

2005-06-27 Thread Grant Edwards
On 2005-06-27, Xah Lee <[EMAIL PROTECTED]> wrote: > i have a large number of lines i want to turn into a list. > In perl, i can do > > @corenames=qw( > rb_basic_islamic > sq1_pentagonTile > sq_arc501Tile > sq_arc503Tile > ); > > use Data::Dumper; > print Dumper([EMAIL PROTECTED]); > > -- >

Re: turn text lines into a list

2005-06-27 Thread Paul McGuire
See definition of splitlines(). (http://docs.python.org/lib/string-methods.html) -- Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: turn text lines into a list

2005-06-27 Thread Matthias Huening
Xah Lee (27.06.2005 12:33): > i have a large number of lines i want to turn into a list. > In perl, i can do > > @corenames=qw( > rb_basic_islamic > sq1_pentagonTile > sq_arc501Tile > sq_arc503Tile > ); > > use Data::Dumper; > print Dumper([EMAIL PROTECTED]); > > -- > is there some short

Re: turn text lines into a list

2005-06-27 Thread Gunnar Hjalmarsson
Xah Lee wrote: > i have a large number of lines i want to turn into a list. > In perl, i can do > > @corenames=qw( > rb_basic_islamic > sq1_pentagonTile > sq_arc501Tile > sq_arc503Tile > ); Impractical to mix code and data, isn't it? chomp( my @corenames = ); __DATA__ rb_basic_islamic sq1_pent

Re: turn text lines into a list

2005-06-27 Thread Reinhold Birkenfeld
Xah Lee wrote: > i have a large number of lines i want to turn into a list. > In perl, i can do > > @corenames=qw( > rb_basic_islamic > sq1_pentagonTile > sq_arc501Tile > sq_arc503Tile > ); > > use Data::Dumper; > print Dumper([EMAIL PROTECTED]); > > -- > is there some shortcut to turn l