Sample and test code shows you are correct. tpsFile - is really the SQL file I will be inserting new policy records into
tagFile - is a CVS file containing all of the information for a new policy in an XMLish fashion (one record per filed of the policy) I will receive from a third party tagIdxFile - is just a file that where the data from the tagFile should be mapped into the tpsFile CODE tpsFile = {'tpsFirstName' : 'Kate', 'tpsLastName' : 'Sumner', 'tpsPhone': '532-1234'} tagFile = {'tagname' : 'tagFirst', 'tagScope' : 'POL0', 'tagValue' : 'Rose'} tagIdxFile = {'idxtagname' : 'tagFirst', 'idxtpsname' : 'tpsFirstName'} print tpsFile['tpsFirstName'] tpsFile[tagIdxFile['idxtpsname']] = tagFile['tagValue'] print tpsFile['tpsFirstName'] RESULTS >>> Kate Rose >>> Just a small note: As trivial as this may seem this task was not possible in the compiled language I work in due to the fact that there was no way for me to get the data referenced by tagIdxFile['idxtpsname'] and then use it as a field label on the left side of the assignment statement because in the compiled language the left side must be a label and NOT and expression. Just strengthens my commitment to learn Python. I would like to thank every one for their help, advice and patients. Len Sumnler Cameron Laird wrote: > In article <[EMAIL PROTECTED]>, > len <[EMAIL PROTECTED]> wrote: > . > . > . > >I have done some more reading and I think the code I need is as > >follows; > > > >mycode = "TagToSQL['mySQLfieldname'] = Tagfile['Value']" > >exec mycode > > > >This is very new to me because I don't believe this can be done in a > >compiled language or at least not as easily as in an interpeted > >language like Python. > > > >I hope this clarifies the problem > . > . > . > I don't understand how > > TagToSQL[mySQLfieldname] = Tagfile[Value] > > fails to meet requirements that > > mycode = "TagToSQL['mySQLfieldname'] = Tagfile['Value']" > exec mycode > > satisfies. > > This thread confuses me. Maybe you already have all the answers > you seek. If not, I recommend that you simplify--perhaps work > through a single example datum in detail. In the meantime, I > applaud your judgment that you can achieve what you're after with > table lookups and such rather than the thousand-way if-else at > which you hinted at least once. -- http://mail.python.org/mailman/listinfo/python-list