eval() in python

harold fellermann harold.fellermann at upf.edu
Tue Jun 21 08:15:57 EDT 2005


> the doc seems to suggest that eval is only for expressions... it says
> uses exec for statements, but i don't seem to see a exec function?

Python 2.4 (#1, Dec 30 2004, 08:00:10)
[GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
 >>> s="print 'hello Xah Lee :-)'"
 >>> exec(s)
hello Xah Lee :-)
 >>>

- harold -

--
I wish there was a knob on the TV to turn up the intelligence.  There's 
a
knob called "brightness", but it doesn't seem to work.
-- Gallagher




More information about the Python-list mailing list