Working on my code I found out a problem with one of the features for my project: Code preview. I open a file with code inside it and reading all the lines I have an array with the lines.
This is the code: Main.py
with open(path.join(files_folder, prj + '.' + file_ext)) as file:
lines = file.readlines()
Then I use the lines variable in HTML: index.html
<ol>
{% for line in lines %}
<li>{{ line }}</li>
{% endfor %}
</ol>
Code inside the file:
while True:
if 10 > 8:
print('Hello World!')
The problem is, using print(lines) in Main.py file, it prints out the lines and the blank spaces but when i print it on HTML there aren't blank spaces.
P.S. I've tried also to print just line but it is equal as the lines print