def run_code_under_monitor(script, monitor):
    sys.path.insert(0, os.path.dirname(script))
    with open(script, 'rb') as handle:
        code = compile(handle.read(), script, 'exec')

    globs = {'__file__': script, '__name__': '__main__', '__package__': None}

    def executor():
        exec code in globs, None

    monitor(executor)()
This is called by render_POST when the client requests an init
dataset/ETHPy150Open enthought/pikos/pikos/runner.py/run_code_under_monitor--crossover with--dataset/ETHPy150Open evennia/evennia/evennia/server/portal/webclient.py/WebClient.mode_init