对于python来说仍然是新手,但这应该很容易。 尝试向python提交表单,但似乎无法在python代码中获取数据
<form name="search" action="/" method="get">
<input type="text" name="search_txtbox" placeholder="Search for...">
<button type="submit" name="findbtn" formtarget="_self">Find</button>
</form>
import cgi
form = cgi.FieldStorage()
@app.route('/searchfile', methods = ["get"])
def searchfile():
result1= request.form['search_txtbox']
result2= request.form.get("search_txtbox")
result3= form.getvalue('firstname')
result4= request.GET['search_txtbox']
result5= form["search_txtbox"].value
真的不明白为什么,任何人都知道为什么或者我能读一些书呆子? 预先感谢