Is there a way I can embed this code in the HTML file rather than have it be text? I'm sorry if that is an awful explanation, but the code and the picture should better put into context my thinking.
Python:
table = [best_words[0:5]]
p = (tabulate(table, tablefmt='html'))
end = time.time()
final_time = '{:.2f}'.format((end-start))
return render_template('index.html', prediction=('{}'.format(p)), final_time=final_time)
Output of Python:
<table>
<tbody>
<tr><td>the</td><td>a</td><td>,</td><td>-</td><td>that</td></tr>
</tbody>
</table>
HTML File:
<h5>Genrated text:</h5>
</div>
<table> <tbody>{{ prediction }} </tbody> </table></div></div> </header>