variable hell

rafi rafi at free.fr
Thu Aug 25 12:03:27 EDT 2005


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

-- 
rafi

	"Imagination is more important than knowledge."
	                            (Albert Einstein)



More information about the Python-list mailing list