From b27296befd358a905881946bc360bfb07bef5530 Mon Sep 17 00:00:00 2001 From: "weiye.wang" Date: Fri, 10 May 2024 23:23:20 +0800 Subject: [PATCH] =?UTF-8?q?flask=E7=BC=96=E5=88=B6=E5=A4=87=E6=B3=A8?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=94=B6=E9=9B=86=E6=A1=86=E6=9E=B6,=20?= =?UTF-8?q?=E5=BE=85=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 工具v4/templates/remarkindex.html | 25 +++++++++++++++++++++++++ 工具v4/备注信息收集.py | 19 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 工具v4/templates/remarkindex.html create mode 100644 工具v4/备注信息收集.py diff --git a/工具v4/templates/remarkindex.html b/工具v4/templates/remarkindex.html new file mode 100644 index 00000000..b7d0b0ac --- /dev/null +++ b/工具v4/templates/remarkindex.html @@ -0,0 +1,25 @@ + + + + Save Data + + +
+ +

+ + +

+ + +

+ + +
+ + \ No newline at end of file diff --git a/工具v4/备注信息收集.py b/工具v4/备注信息收集.py new file mode 100644 index 00000000..eb275265 --- /dev/null +++ b/工具v4/备注信息收集.py @@ -0,0 +1,19 @@ +from flask import Flask, render_template, request +from database_tools_2 import * + +app = Flask(__name__) + +@app.route('/', methods=['GET', 'POST']) +def index(): + if request.method == 'POST': + text1 = request.form['text1'] + text2 = request.form['text2'] + category = request.form['category'] + AppendTextFile(f"{text1.zfill(6)}\n({GetDate()}{category}){RefinePunctuations(text2)}\n","临时文件/备注收集.txt") + + return "备注收集完成, 感谢支持数据库建设" + + return render_template('remarkindex.html') + +if __name__ == '__main__': + app.run(debug=True) \ No newline at end of file