I'm new to python and I was wondering how to put a variable inside a string to show the contents of such variable in an LCD 20x4 display (2004A).
The code I have looks as follows:
with open("temperature.txt") as myfile:
currenttemp=myfile.readlines()
lcd_string("%(currenttemp)" ,LCD_LINE_1,2)
Unfortunately, this prints "%(currenttemp)"
in the LCD display, and not the currenttemp variable value.