From c8cd7bbc0c87c16ec357cb8b2290efa4a71d113e Mon Sep 17 00:00:00 2001 From: pbr4nzfkh <18879212807@163.com> Date: Sun, 17 Mar 2024 16:00:10 +0800 Subject: [PATCH] =?UTF-8?q?Delete=20'=E5=9F=BA=E6=9C=AC=E7=BB=93=E6=9E=84/?= =?UTF-8?q?042=20restful/tf-35-app.py'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 基本结构/042 restful/tf-35-app.py | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 基本结构/042 restful/tf-35-app.py diff --git a/基本结构/042 restful/tf-35-app.py b/基本结构/042 restful/tf-35-app.py deleted file mode 100644 index 848cbd6..0000000 --- a/基本结构/042 restful/tf-35-app.py +++ /dev/null @@ -1,23 +0,0 @@ -from flask import Flask, request -from cppy.cp_util import * - -''' -使用Flask构建一个简单的服务端 -该服务端能够接收POST请求,并返回词频统计结果 -先运行该代码搭建起服务端,然后运行request文件进行词频统计 -''' -app = Flask(__name__) - -@app.route('/word_frequency', methods=['POST']) -def word_frequency(): - # 获取POST请求中的JSON数据 - data = request.get_json() - data = data['file'] - # 统计词频 - word_freq = get_frequencies(data) - word_freq = sort_dict(word_freq) - return word_freq - -if __name__ == '__main__': - app.run(debug=True) -