def _btn_login_clicked(self): access_key_id = self.ui.le_access_key_id.text() secret_key_id = self.ui.le_secret_key_id.text() # note: for us select: eu-central-1 region = self.ui.cbx_region.itemText(self.ui.cbx_region.currentIndex()) print("access_key_id:", access_key_id) print("secret_key_id:", secret_key_id) print("region:", region) try: conn = boto.ec2.connect_to_region(region, aws_access_key_id=access_key_id, aws_secret_access_key=secret_key_id) mv = MainWindow(conn) mv.setWindowModality(Qt.ApplicationModal) mv.show() # self.close() except boto.exception.EC2ResponseError: msg = "Impossible to log in using these credentials.\n" \ "Please check your credentials and regions" QMessageBox.critical(self, "Cannot login!", msg)
def main(): # Initialize application app = QApplication(sys.argv) app.setWindowIcon(QIcon(PATH_ICONS + "icon.png")) # Localization (will fallback to English) translator = QTranslator() translator.load(PATH_TRANSLATIONS + str(QLocale.system().name()) + '.qm') app.installTranslator(translator) # Show main window main_window = MainWindow() main_window.show() # Bind application to system exit sys.exit(app.exec_())
#!/usr/bin/env python3 from PyQt4.QtGui import * from views.MainWindow import MainWindow if __name__ == "__main__": app = QApplication([]) main_widget = MainWindow() main_widget.show() app.exec_()
from views.MainWindow.MainWindow import * if __name__ == "__main__": mainWindow = MainWindow() mainWindow.run() pass
def startMainApplication(): mainWindow = MainWindow() mainWindow.showMainWindow()
def __init__(self): self.window = MainWindow() self.connectUI() self.openFile = None self.openImage: Optional[ColorImage] = None
def new_window(self, *args): MainWindow(self)
import sys from PyQt5.QtWidgets import QApplication from views.MainWindow import MainWindow if __name__ == '__main__': app = QApplication(sys.argv) main = MainWindow() main.showMaximized() sys.exit(app.exec_())
def __init__(self, sys_argv): super(App, self).__init__(sys_argv) self.MainWindow = MainWindow() self.MainWindow.show()
class App(QApplication): def __init__(self, sys_argv): super(App, self).__init__(sys_argv) self.MainWindow = MainWindow() self.MainWindow.show()
from PyQt5.QtWidgets import QApplication from views.MainWindow import MainWindow import sys # inicio de instancia da janela inicial da aplicação root = QApplication(sys.argv) app = MainWindow() app.show() sys.exit(root.exec_())