[EMAIL PROTECTED] wrote: > Is there any function which will return a variable by passing to it > the string containing the variable's name? Something like this for > instance: > > foo = some_function("foo") > > or perhaps it's a dictionary. I don't know, but I would really like to > find out how it can be done. I guess it is achievable. > > Thank you. >
vars()["foo"] but if you are doing this you are almost certainly making your life harder than it needs to be. Usually you really just want to keep the values in a dict. -- Duncan Booth http://kupuguy.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list