I'm just have a little fun here, but I bet that comments will help further elighten me on the subtleties of python.
consider the following console session: >>> L = ['foo','bar'] >>> locals()[L[0]] = L[1] >>> foo 'bar' >>> 'foobar' in locals() False >>> 'foo' in locals() True >>> locals() {'__builtins__': <module '__builtin__' (built-in)>, 'L': ['foo', 'bar'], '__package__': None, '__name__': '__main__', 'foo': 'bar', '__doc__': None} Given that I have a text file as input with names and values with a seperator (TAB, for instance) I could initialize variables in a local scope, or I could build a dictionary. Actually the dictionary is preferable for the targeted application. However, for the sake of edification, I would welcome comments on the session above, and let's pretend that `L' is the result of a line read from a file and split on '\t'. TIA tim -- Tim tim at johnsons-web.com or akwebsoft.com http://www.akwebsoft.com _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor