# Create the applicationapp=QApplication(sys.argv)# Connect to the database before creating any windowifnotcreateConnection("contacts.sqlite"):sys.exit(1)# Create the main window if the connection succeededwin=Window()win.show()# Run the event loopsys.exit(app.exec_())