Hello Toby, > I'm designing an educational application that will run Python code and > check the output against a pre-define answer. I want to use the "exec" > statement to run the code, but I don't know how to get output from it. [...] The battaries are there already... http://www.python.org/doc/current/lib/module-doctest.html HTH. Miki