html('<h2>Profile the given input</h2>')
import cProfile; import profile
@interact
def _(cmd = ("Statement", '2 + 2'),
do_preparse=("Preparse?", True), cprof =("cProfile?", False)):
if do_preparse: cmd = preparse(cmd)
if cprof:
cProfile.runctx(cmd,globals(), locals())
else:
profile.runctx(cmd,globals(), locals())