def run():
""" Expects a json dictionary that specifies the language, code snippet, any
expected input for the snippet. """
content = request.get_json()
if content is None:
return jsonify({'status': -1, 'output': 'no input'})
print(content)
err, output = sandbox.execute(
content.get('lang').lower(),
content.get('code'),
content.get('params'),
os.path.join(os.getcwd(), 'tmp'))
print("error code {}\n{}".format(err, output))
return jsonify({'status': err, 'output': output})
评论列表
文章目录