feat: add exp file download
This commit is contained in:
@@ -34,6 +34,14 @@ def download_file(filename):
|
|||||||
abort(404)
|
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):
|
def write_to_csv(data):
|
||||||
"""
|
"""
|
||||||
将成绩记录写入 CSV 文件。
|
将成绩记录写入 CSV 文件。
|
||||||
@@ -74,4 +82,4 @@ def get_scores():
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
app.run(host="0.0.0.0", port=880)
|
app.run(host="0.0.0.0", port=880, debug=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user