Utilities relating to emulating interactive Python execution