get a list from a string

Dustan DustanGroups at gmail.com
Thu Jun 7 07:40:21 EDT 2007


On Jun 7, 6:06 am, simon kagwe <simonka... at yahoo.com> wrote:
> > exec("distances = [[1,1,1,1],[2,2,2,2]]")

To be clear, exec is *not* a function; it's a statement. That means it
can't be used in lambda functions, for example.

> Wow! So simple!

but dodgy, as it'll execute any python code.

> Thanks a lot. :-)




More information about the Python-list mailing list