Benji York schrieb: >> >>> suffix = 'var' >> >>> vars()['a%s' % suffix] = 45 >> >>> avar >> 45 > > > Quoting from http://docs.python.org/lib/built-in-funcs.html#l2h-76 about > the "vars" built in: > > The returned dictionary should not be modified: the effects on the > corresponding symbol table are undefined.
I tried this once and it worked. This may be too naive, so thanks for the warning :) -- ------------------------------------------------------------------- Peter Maas, M+R Infosysteme, D-52070 Aachen, Tel +49-241-93878-0 E-mail 'cGV0ZXIubWFhc0BtcGx1c3IuZGU=\n'.decode('base64') ------------------------------------------------------------------- -- http://mail.python.org/mailman/listinfo/python-list