eval syntax problem

Erik Max Francis max at alcyone.com
Wed Nov 17 05:16:23 EST 2004


Matthias Teege wrote:

> what is wrong with
> 
> eval('print %s %s %s' % ('%s', '%', 'foo'))

print is a statement, not an expression, and eval only handles 
expressions.  Use exec instead.

-- 
Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
   Perfect situations must go wrong
   -- Florence, _Chess_



More information about the Python-list mailing list