feat: add exp file download

This commit is contained in:
2024-09-23 05:18:37 +08:00
parent cd1f656fe0
commit 5c9566a7b4
+9 -1
View File
@@ -34,6 +34,14 @@ def download_file(filename):
abort(404)
@app.route("/exp/<path:filename>", methods=["GET"])
def exp(filename):
try:
return send_from_directory("exp", filename, as_attachment=True)
except FileNotFoundError:
abort(404)
def write_to_csv(data):
"""
将成绩记录写入 CSV 文件。
@@ -74,4 +82,4 @@ def get_scores():
if __name__ == "__main__":
app.run(host="0.0.0.0", port=880)
app.run(host="0.0.0.0", port=880, debug=True)