variable hell
Reinhold Birkenfeld
reinhold-birkenfeld-nospam at wolke7.net
Thu Aug 25 15:45:01 EDT 2005
rafi wrote:
> Adriaan Renting wrote:
>> You might be able to do something along the lines of
>>
>> for count in range(0,maxcount):
>> value = values[count]
>> exec(eval("'a%s=%s' % (count, value)"))
>
> why using the eval?
>
> exec ('a%s=%s' % (count, value))
>
> should be fine
And this demonstrates why exec as a statement was a mistake ;)
It actually is
exec 'a%s=%s' % (count, value)
Reinhold
More information about the Python-list
mailing list