예제 #1
0
def qajudge_post():
    f = request.files["file"]
    if f and allowed_file(f.filename):
        filename = rename(secure_filename(f.filename))
        fn = os.path.join(app.config["UPLOAD_FOLDER"], filename)
        f.save(fn)
        result = judge(fn)
        if type(result) is type(""):
            return result
        save_result(result)
        return " ".join([str(i) for i in result])
    return "上传失败"
예제 #2
0
def nlpjudge_post():
    f = request.files["file"]
    pos = request.form["type"].lower() in ("true", "yes")
    if f and allowed_file(f.filename):
        filename = rename(secure_filename(f.filename))
        fn = os.path.join(app.config["UPLOAD_FOLDER"], filename)
        f.save(fn)
        result = judge(fn, pos)
        if type(result) is type(""):
            return result
        save_result(pos, result)
        return " ".join([str(i) for i in result])
    return "上传失败"