def check_connection(): if Authority.check_internet(): login_window.after(1000, check_connection) # check again in 1 second else: login_window.destroy() # close the GUI window
此部分为tk写的
timer = QTimer() timer.timeout.connect(my_pyqt_form.check_connection) timer.start(1000)
此部分为qt写的