eval syntax problem

Matthias Teege matthias-dated at mteege.de
Wed Nov 17 03:53:12 EST 2004


Moin,

what is wrong with

eval('print %s %s %s' % ('%s', '%', 'foo'))

I try to pass a format string to an assignment. Like this

fmt='%.2f'
a=1
b="fmt %" % a

Matthias
-- 
Matthias Teege -- http://www.mteege.de
make world not war



More information about the Python-list mailing list