a simple def how-to

vsoler vicente.soler at gmail.com
Sun Mar 7 16:05:26 CET 2010


Hello,

My script starts like this:

book=readFromExcelRange('book')
house=readFromExcelRange('house')
table=readFromExcelRange('table')
read=readFromExcelRange('read')
...

But I would like to have something equivalent, like...

ranges=['book','house','table','read']
for i in ranges:
    var[i]=readFromExcelRange(i)

which does not work. I assume I should be using globals() instead of
var, but I do not know how to write my script.

Can anybody help?



More information about the Python-list mailing list