While writing a GUI application in PyQt5 I encounter weird(for me) behavior. When I wanted to open an information window and start doing another thing after it fully loads.
Here is a single-line solution:
from PyQt5.QtWidgets import QApplication,QMessageBox import sys import os app = QApplication(sys.argv) box = QMessageBox() box.setText("Text") box.show() QApplication.processEvents() # <------------ this one os.system("ping 8.8.8.8 ") sys.exit(app.exec())