String2List: odd function
Bernhard Herzog
herzog at online.de
Thu Jul 29 05:55:47 EDT 1999
More information about the Python-list mailing list
Thu Jul 29 05:55:47 EDT 1999
- Previous message (by thread): String2List: odd function
- Next message (by thread): String2List: odd function
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
"Fredrik Lundh" <fredrik at pythonware.com> writes: > well, last time I checked, eval didn't accept statements. True, but if the eval'ed code has access to the normal builtins, you can sneak statements into the expression with compile: >>> eval('''eval(compile("for i in range(10): print i", "", "exec"))''') 0 1 2 3 4 5 6 7 8 9 >>> -- Bernhard Herzog | Sketch, a python based drawing program herzog at online.de | http://www.online.de/home/sketch/
- Previous message (by thread): String2List: odd function
- Next message (by thread): String2List: odd function
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list