Create a variable "on the fly"

Paul D.Smith paul_d_smith at x-hotmail.com
Wed Jul 27 12:34:06 EDT 2005


Can Python create a variable "on-the-fly".  For example I would like
something like...

make_variable('OSCAR', 'the grouch');
print OSCAR;

...to output...

the grouch

Anything like this in Python?

And in case anyone is interested, I want to instantiate a set of variables
based on environment variables without using os.environ everywhere by having
a look instantiate Python variables of the appropriate type.

Thanks,
Paul DS.

-- 
Please remove the "x-" if replying to sender.





More information about the Python-list mailing list