When i run the below program from the console , it is showing the data it receives from serial input in the console.
But , I want to display the data in the webpage , maybe in a box. How can I do it?
The python program is
from serial import Serial
ser = Serial('COM4', 115200, timeout=1)
print("connected to: " + ser.portstr)
# Read a line and convert it from b'xxx\r\n' to xxx
line = ser.readline().decode('utf-8')[:-2]
if line: # If it isn't a blank line
if line == '520':
subprocess.call(["xte", "key Up"])
elif line == '620':
subprocess.call(["xte", "key Down"])
elif line == '110':
The data is continuously generated as it receives from the sensor. I need to show the last available data