views.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:QuickTry-Server 作者: QuickTry 项目源码 文件源码
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})
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号