You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
1.1 KiB

4 weeks ago
from flask import Flask, jsonify
app = Flask(__name__, static_folder="public", static_url_path="")
# WPS表格处理知识点数据
wps_table_data = {
"introduction": "WPS表格是一款功能强大的电子表格软件,适用于数据分析和报告。",
"functions": [
"数据排序:快速对数据进行升序或降序排列。",
"数据筛选:根据特定条件筛选数据。",
"公式计算:支持多种数学和统计公式。",
"图表制作:轻松创建各种图表,如柱状图、饼图等。",
"数据透视表:对大量数据进行快速汇总和分析。"
],
"tips": [
"使用快捷键可以提高工作效率。",
"定期保存工作,避免数据丢失。",
"利用模板可以快速创建表格。"
]
}
# 根路径返回 index.html
@app.route("/")
def serve_index():
return app.send_static_file("index.html")
# API 子路径,提供WPS表格处理知识点数据
@app.route("/api/wps-table")
def api_wps_table():
return jsonify(wps_table_data)
if __name__ == "__main__":
app.run(debug=True, port=81)