name, result = QtWidgets.QInputDialog.getText(MainWindow, "Name of the Team", "Enter the name of your team:") # Put this code inside a function and connect it to any signal.