MCPcopy Index your code
hub / github.com/datacamp/pythonwhat / run_code

Function run_code

pythonwhat/local.py:145–155  ·  view source on GitHub ↗
(executor, code)

Source from the content-addressed store, hash-verified

143
144
145def run_code(executor, code):
146 with io.StringIO() as output:
147 try:
148 with redirect_stdout(output):
149 executor(code)
150 raw_output = output.getvalue()
151 error = None
152 except BaseException as e:
153 raw_output = ""
154 error = str(e)
155 return raw_output, error
156
157
158def run_single_process(pec, code, pid=None, mode="simple"):

Callers 2

__call__Method · 0.85
run_single_processFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected