• 个人冲刺第八天6.16


    from flask import Flask, jsonify, render_template, request, json

    import mysqlUtil

    app = Flask(__name__)


    @app.route("/c1")
    def hellv():
    return render_template('view.html')

    @app.route("/text")
    def hellt():
    return render_template('text.html')

    @app.route("/findlunwen")
    def hello():
    return


    @app.route("/")
    def hellp():
    return render_template('find.html')


    @app.route("/c2", methods=['POST', 'GET'])
    def wordcloud():
    res0 = []
    res1 = []
    temp = mysqlUtil.select_key()
    print(temp)
    for i in temp:
    res0.append(i[0]) # keyword
    res1.append(i[1]) # value
    return jsonify({"keyword": res0, "value": res1})


    @app.route("/c3", methods=['POST', 'GET'])
    def select_lunwen():
    res0 = []
    res1 = []
    res2 = []
    res3 = []
    tiaojian = request.args.get("tiaojian")
    firinput = request.args.get("firinput")
    jingzhun = request.args.get("jingzhun")
    # print(tiaojian)
    # print(firinput)
    # print(jingzhun)
    if jingzhun == '精准':
    if tiaojian == '题目':
    temp = mysqlUtil.select_lunwenj('title', firinput)
    elif tiaojian == '摘要':
    temp = mysqlUtil.select_lunwenj('abstract', firinput)
    elif tiaojian == '作者':
    temp = mysqlUtil.select_lunwenj('zuozhe', firinput)
    elif tiaojian == '关键词':
    temp = mysqlUtil.select_lunwenj('abstract', firinput)

    else:
    if tiaojian == '题目':
    temp = mysqlUtil.select_lunwenm('title', firinput)
    elif tiaojian == '摘要':
    temp = mysqlUtil.select_lunwenm('abstract', firinput)
    elif tiaojian == '作者':
    temp = mysqlUtil.select_lunwenm('zuozhe', firinput)
    elif tiaojian == '关键词':
    temp = mysqlUtil.select_lunwenm('abstract', firinput)
    for i in temp:
    res0.append(i[0]) # title
    res1.append(i[1]) # link
    res2.append(i[3]) # zuozhe
    res3.append(i[4]) # time
    qw = jsonify({"title": res0, "zuozhe": res2, "time": res3, "lianjie": res1})
    return jsonify({"title": res0, "zuozhe": res2, "time": res3, "lianjie": res1})




    if __name__ == '__main__':
    app.run(debug=True, host='127.0.0.1', port='5000')
  • 相关阅读:
    洛谷T44252 线索_分治线段树_思维题
    css 迷惑的position
    【二次元的CSS】—— 用 DIV + CSS3 画大白(详解步骤)
    直接使用sublime编译stylus
    w3schools网站的HTML教程之HTML编辑器
    【二次元的CSS】—— 纯CSS3做的能换挡的电扇
    《JavaScript Dom编程艺术》读书笔记(二)
    JQuery基础修炼-样式篇
    Vue.js 开发实践:实现精巧的无限加载与分页功能
    web前端教程《每日一题》(1-99)完结
  • 原文地址:https://www.cnblogs.com/wanghaoning/p/14914590.html
Copyright © 2020-2023  润新知