generator expression works in shell, NameError in script

Emile van Sebille emile at fenx.com
Thu Jun 18 00:46:50 CEST 2009


On 6/17/2009 3:41 PM Jason Tackaberry said...
> How about:
> 
>    enumerate([''] + titles)
> 

or perhaps, depending on usage...

list(enumerate(titles))

Emile




More information about the Python-list mailing list