strings question

William Park opengeometry at yahoo.ca
Fri Mar 12 13:37:35 EST 2004


Faheem Mitha <faheem at email.unc.edu> wrote:
> Dear People,
> 
> If I am given two strings, named foo and bar, what is the most elegant
> way to create a string object whose name is the value of foo and whose
> value is the value of bar? I have done some searching + looking in my
> introductory textbook "Learning Python" but have not come up with an
> answer yet.
> 
> Thanks.                                                      Faheem.

Read the doc on 'eval' and 'exec'.

-- 
William Park, Open Geometry Consulting, <opengeometry at yahoo.ca>
Linux solution for data processing and document management.



More information about the Python-list mailing list