turn text lines into a list

Gunnar Hjalmarsson noreply at gunnar.cc
Mon Jun 27 06:45:32 EDT 2005


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> );

__DATA__
rb_basic_islamic
sq1_pentagonTile
sq_arc501Tile
sq_arc503Tile

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl



More information about the Python-list mailing list