turn text lines into a list

Grant Edwards grante at visi.com
Mon Jun 27 10:27:28 EDT 2005


On 2005-06-27, Xah Lee <xah at xahlee.org> 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(\@corenames);
>
> ----------
> is there some shortcut to turn lines into list in Python?

corenames = [ "rb_basic_islamic",
              "sq1_pentagonTile",
              "sq_arc501Tile",
              "sq_arc503Tile"]

-- 
Grant Edwards                   grante             Yow!  TAILFINS!!...click...
                                  at               
                               visi.com            



More information about the Python-list mailing list