On Wed, May 13, 2009 at 9:17 PM, Wells <we...@submute.net> wrote: > Can you take a list and have it exploded into variables w/ one > command? Something like.. > > > list = ['foo', 'bar'] > [a, b] = list > > Then 'a' would be foo and 'b' 'bar'.
Did you think to try it at the interpreter? That exact syntax works, though we usually write it without the brackets, like: a, b = list Also, don't use "list" as a variable name since it clashes with the builtin type. Cheers, Chris -- http://blog.rebertia.com -- http://mail.python.org/mailman/listinfo/python-list