I have a question regarding adding variable value to text that is read from file. My situation is that I would like to have separate html file with variables that would pull value from code.
Example of .txt file:
"""Current value of variable x is: """ + str(x) + """ and so on."""
Code that I have tried, is:
x = 5
f = open("C:\\Test\\reading.txt",'r')
print(f.read())
What I would like to finish with is:
"""Current value of variable x is: 5 and so on."""
Reason why I would like to have it is to have separate html file, generate html code from it in combination with variable values and than use that string further for sending email. Worst case, I can embed html code into code where I calculate variable values, but would be more handy to keep them separated.
jinjawhich is used e.g. inflask.