我试图在Flask中链接一个url,但找不到解决问题的方法。我的想法是根据我网页上给出的参数在UniProt中搜索一种蛋白质。例如:
@app.route('/http.html')
def http():
return render_template('http.html')
@app.route('/http_results', methods=['POST'])
def http_results():
protname_seq = request.form['protname_seq']
specie_seq = request.form['specie_seq']
input_text = seqtools.httplink(protname_seq,specie_seq)
return render_template('http_results.html', **locals())
在seqtools
中,我有一个python代码,它具有以下函数:
而现在在http_results.html
我尝试了多种方法,但最终结果是None或者是一个错误,所以我真的不知道如何继续。http_results.html
代码是:
只想知道链接到UniProt网页的蛋白质名称。谢谢你的帮助,对不起我的英语。在
print
函数返回None
,因此,您需要将print
和赋值操作分成两行:另外,您需要在
^{pr2}$a
标记中的href
加引号:在名为
httplink
的函数中,您不分配c
任何内容。您应该在print语句中返回字符串文本。在这个功能应该可以解决这个问题。在
相关问题 更多 >
编程相关推荐