写了一个nlp的程序,使用了python,flask框架,前端是h5写的。
不知道问题到底出在哪里,每次页面切换的时候都会显示这个问题
页面跳转使用的是(以下面代码为例):
render_template('index.html', result=result, user=user)
大体的前后端交互类似于下方的代码,但是这个方法无法响应
<form action="/{{result}}" method="post">
<input type="button" value="下载结果">
</form>
#python代码
@app.route('/<result>',methods=['POST'])
def download(result):
print("yes")
# 用时间作为文件名
now = datetime.datetime.now()
t = now.strftime("%Y-%m-%d %H:%M:%S")
tn = t + '.txt';
# 保存文件
print("file")
f = open(tn, mode='w');
f.write(result);
f.close();
win32api.MessageBox(0, "下载成功!", "Message", win32con.MB_OK)
求大神指教