python: calling constructor from dictionary?
Posted
by Jason S
on Stack Overflow
See other posts from Stack Overflow
or by Jason S
Published on 2010-05-18T14:17:19Z
Indexed on
2010/05/18
14:20 UTC
Read the original article
Hit count: 236
python
|dictionary
I'm not quite sure of the terminology here so please bear with me....
Let's say I have a constructor call like this:
machineSpecificEnvironment = Environment(
TI_C28_ROOT = 'C:/appl/ti/ccs/4.1.1/ccsv4/tools/compiler/c2000',
JSDB = 'c:/bin/jsdb/jsdb.exe',
PYTHON_PATH = 'c:/appl/python/2.6.4',
)
except I would like to replace that by an operation on a dictionary provided to me:
keys = {'TI_C28_ROOT': 'C:/appl/ti/ccs/4.1.1/ccsv4/tools/compiler/c2000',
'JSDB': 'c:/bin/jsdb/jsdb.exe',
'PYTHON_PATH': 'c:/appl/python/2.6.4'}
machineSpecificEnvironment = Environment(
... what do I put here? it needs to be a function of "keys" ...
)
How can I do this?
© Stack Overflow or respective owner