【发布时间】:2018-09-24 05:29:57
【问题描述】:
我想在 Flask 的 Html 页面上打印 python 控制台输出。请有人帮我做同样的事情。我做了三个文件。 app.py、index.html 和 result.html。
我的 app.py:
for i in image_path_list:
j=j+1
if i in duplicate:
continue
else:
print(i+" "+str(count[j])+"\n")
return render_template('results.html', file_urls=file_urls)
if __name__ == '__main__':
app.run()
这是我的结果.html
<h1>Hello Results Page!</h1>
<a href="{{ url_for('index') }}">Back</a><p>
<ul>
{% for file_url in file_urls %}
<li><img style="height: 150px" src="{{ file_url }}"></li>
{% endfor %}
</ul>
【问题讨论】:
-
从 src 中删除引号
标签: python python-3.x flask flask-restful