diff --git a/.gitignore b/.gitignore index 200a40c8..6e8a356b 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,6 @@ **/*.conda*/* **/*cache*/* .vscode/* +*使用指南*.html **/*test* -*html *.sh diff --git a/工具v4/flask框架.py b/工具v4/flask框架.py new file mode 100644 index 00000000..05036216 --- /dev/null +++ b/工具v4/flask框架.py @@ -0,0 +1,14 @@ +from flask import Flask, render_template, request + +app = Flask(__name__) + +@app.route('/', methods=['GET', 'POST']) +def index(): + if request.method == 'POST': + selected_checkboxes = request.form.getlist('checkbox') + selected_radioboxes = request.form.getlist('radiobox') + return render_template('result.html', checkboxes=selected_checkboxes, radioboxes=selected_radioboxes) + return render_template('index.html') + +if __name__ == '__main__': + app.run(debug=True) \ No newline at end of file diff --git a/工具v4/templates/index.html b/工具v4/templates/index.html new file mode 100644 index 00000000..84cee40c --- /dev/null +++ b/工具v4/templates/index.html @@ -0,0 +1,30 @@ + + +
+