class mywindow2(QtWidgets.QMainWindow):
def __init__(self):
super(mywindow2, self).__init__()
self.ui = My_Window()
self.ui.setupUi(self)
def show_w2(self):
w2 = mywindow2()
w2.show()
sys.exit(app.exec())