html_code = """ Sentiment Analysis

Sentiment Analysis

{% if sentiment %}
Sentiment: {{ sentiment }}
{% endif %}
""" with open("templates/index.html", "w") as file: file.write(html_code)