String to sequence

Frank Pan frankpzh at gmail.com
Sat Mar 14 05:24:53 EDT 2009


>>> a = eval("[%s]" %
"'AAR','ABZ','AGA','AHO','ALC','LEI','AOC','EGC','SXF','BZR','BIQ','BLL','BHX','BLQ'")
>>> a
['AAR', 'ABZ', 'AGA', 'AHO', 'ALC', 'LEI', 'AOC', 'EGC', 'SXF', 'BZR',
'BIQ', 'BLL', 'BHX', 'BLQ']


On Sat, Mar 14, 2009 at 5:09 PM, mattia <gervaz at gmail.com> wrote:

> How can I convert the following string:
>
> 'AAR','ABZ','AGA','AHO','ALC','LEI','AOC',
> EGC','SXF','BZR','BIQ','BLL','BHX','BLQ'
>
> into this sequence:
>
> ['AAR','ABZ','AGA','AHO','ALC','LEI','AOC',
> EGC','SXF','BZR','BIQ','BLL','BHX','BLQ']
>
> Thanks a lot,
> Mattia
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090314/d5a3f562/attachment-0001.html>


More information about the Python-list mailing list