это то, что я ожидаю
это то, что я получаю
это код html, где я отображаю свои данные:
{% extends 'base.html' %}
{% block body %}
<h2>{{ the_title }}</h2>
<p>You submitted the following data:</p>
<table>
<tr><td>Phrase:</td><td>{{ the_phrase }}</td></tr>
<tr><td>Letters:</td><td>{{ the_letters }}</td></tr>
</table>
<p>When "{{the_phrase }}" is search for "{{ the_letters }}", the following
results are returned:</p>
<h3>{{ the_results }}</h3>
{% endblock %}
это код python, который отображает мои данные:
@app.route('/viewlog')
def view_the_log() -> 'html':
contents=[]
with open('vsearch.log') as log:
for line in log:
contents.append([])
for item in line.split('|'):
contents[0].append(escape(item))
titles = ('Form Data','Remote_addr','User_agent','Results')
return render_template('viewlog.html',
the_title='View Log',
the_row_titles=titles,
the_data=contents,)