Consider this minimal code snippet :
from PyQt5.QtWidgets import QApplication,QWidget,QLabel
app=QApplication([])
w=QWidget()
l=QLabel(w)
l.setText("Ready")
w.show()
def load():
l.setText('Loading...')
some_function()
l.setText('Loaded')
load()
The desired output here is that the QLabel
text should change to 'Loading...' first and then after some_function() finishes it's task, it should change to 'Loaded'
But that isn't how it's working. The 'Loading...' text never appears. It jumps straight from 'Ready' to 'Loaded' after the completion of some_function(). Why is that happening?