class Ui_Shop_Dashboard_Form(object):
def setupUi(self, Shop_Dashboard_Form):
Shop_Dashboard_Form.setObjectName("Shop_Dashboard_Form")
Shop_Dashboard_Form.resize(750, 300)
Shop_Dashboard_Form.setMaximumSize(QtCore.QSize(750, 300))
font = QtGui.QFont()
font.setBold(False)
font.setWeight(50)
Shop_Dashboard_Form.setFont(font)
self.gridLayout = QtWidgets.QGridLayout(Shop_Dashboard_Form)
self.gridLayout.setObjectName("gridLayout")
BLA
BLA
BLA
#loop event for refreshing data
#*********************************************************************
def printit():
threading.Timer(5.0, printit).start()
print ("Hello, World!")
printit()
Hello, Quick question. I want to run a thread timer in my main application. I was wondering will the tread shut down when the application closes or does it continue to run in the back ground?
I will obviously replace the print ("Hello, World") with a call function to refresh data from the SQL server. But be before I do I want to be sure when the application closes that the thread will close with it. I do not want to continual refresh data from the server after the main window closes. I ran it in Visual studio codes and when I close the application it continues to print hello world in the terminal. so I am not confident it will close. can I get a bit of help on this as I am still new to Python and I have never worked with Treading before. If there is a smarter way to run a function every 30 minutes please let me know. Thank you in advance.