Flask appears to prevent PyQt5 UI from updating.
The respective code works properly for either PyQt5 or Flask - but not together. I understand that it may need to do with the way threading is set up.
Any assistance would be greatly appreciated. TIA.
`
import sys
import serial
import threading
from PyQt5.QtWidgets import QWidget, QLabel, QApplication
from flask import Flask, render_template, request, redirect, url_for
app1 = Flask(__name__)
ser = serial.Serial ("/dev/ttyS0", 57600,timeout=3)    #Open port with baud rate
count=0
temp = []
class Example(QWidget):
    def __init__(self):
        super().__init__()
        self.initUI()
    def initUI(self):
        global count
        count = 1
        self.setGeometry(300, 300, 250, 150)
        self.setWindowTitle('PyQt5 vs Flask')
        self.lbl1 = QLabel('Count '+str(count), self)
        self.lbl1.move(100, 50) 
        self.show()
        threading.Timer(5,self.refresh).start()
    def refresh(self):
        global count
        count +=1
        print("UI ",count)
        self.lbl1.setText('Count'+str(count))
        threading.Timer(5,self.refresh).start()
def get_uart():
    global temp
    if ser.inWaiting()>0:
        temp =[str(float(x.decode('utf-8'))) for x in ser.read_until().split(b',')]
        print(temp)
    threading.Timer(1,get_uart).start()
@app1.route("/")
def index():
    global temp  
    templateData = {'temp1' : temp[1] ,'temp2' : temp[2]}
    return render_template('index.html',**templateData)
if __name__ == "__main__":   
    app = QApplication(sys.argv)
    pyqt5 = Example()
    threading.Timer(1,get_uart).start()    
    ser.flushInput()
    #app1.run(host='0.0.0.0',threaded=True, port=5000) # ,debug=True)    
    sys.exit(app.exec_())
`
Need to have a UI to control the data analysis to be displayed on Website.