Timed execution in eval

castironpi at gmail.com castironpi at gmail.com
Fri Mar 7 21:25:22 CET 2008


On Mar 7, 10:12 am, alex.pedwyso... at gmail.com wrote:
> I have various bits of code I want to interpret and run at runtime in
> eval ...
>
> I want to be able to detect if they fail with error, I want to be able
> to time them, and I want to be able to stop them if they run too
> long.  I cannot add code to the eval'd strings that will help me
> accomplish this.
>
> Is there a good way to do this?  I have it figured out for perl but
> I'd rather use python if possible.
>
> Thanks for any assistance.

How does this sound?  Write back if it's way far off from what you
want.

for line in break in put on line break
   push in interactive console
   extra linebreak at function ends
return list of functions?

... and I'll stop before I actually write it.  Bets off!



More information about the Python-list mailing list