Q:

Как в PyQt5 к кнопке привязать другое окно и преобразовать всё в .exe файл?

Имеются 2 программы: бинарный калькулятор и прогноз погоды в отдельных окнах.

Надо сделать так, чтобы при нажатии на соответствующие кнопки в меню отображались соответствующие окна программ.

К главному меню относятся файлы mintro.py и mintro1.py:
mintro.py:
from PySide2 import QtCore, QtGui, QtWidgets

class Ui_Dialog(object):
    def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(371, 300)
        Dialog.setStyleSheet("background-color:#8430b8;")
        self.pushButton = QtWidgets.QPushButton(Dialog)
        self.pushButton.setGeometry(QtCore.QRect(30, 160, 311, 51))
        self.pushButton.setStyleSheet("color:#d7e535;\n"
"font: 14pt \"Onyx\";\n"
"background-color:#494f8a;")
        self.pushButton.setObjectName("pushButton")
        self.pushButton_2 = QtWidgets.QPushButton(Dialog)
        self.pushButton_2.setGeometry(QtCore.QRect(30, 220, 311, 51))
        self.pushButton_2.setStyleSheet("color:#e01414;\n"
"font: 14pt \"Onyx\";\n"
"background-color:#dff022;")
        self.pushButton_2.setObjectName("pushButton_2")
        self.label = QtWidgets.QLabel(Dialog)
        self.label.setGeometry(QtCore.QRect(0, 30, 371, 51))
        self.label.setStyleSheet("color:#22f70f;\n"
"font: 8pt \"Playbill\";\n"
"border:none;\n"
"")
        self.label.setObjectName("label")
        self.label_2 = QtWidgets.QLabel(Dialog)
        self.label_2.setGeometry(QtCore.QRect(30, 70, 321, 81))
        self.label_2.setStyleSheet("font: 11pt \"MV Boli\";\n"
"")
        self.label_2.setObjectName("label_2")

        self.retranslateUi(Dialog)
        QtCore.QMetaObject.connectSlotsByName(Dialog)

    def retranslateUi(self, Dialog):
        Dialog.setWindowTitle(QtWidgets.QApplication.translate("Dialog", "Dialog", None, -1))
        self.pushButton.setText(QtWidgets.QApplication.translate("Dialog", "Бинарный калькулятор", None, -1))
        self.pushButton_2.setText(QtWidgets.QApplication.translate("Dialog", "Узнать погоду в городе", None, -1))
        self.label.setText(QtWidgets.QApplication.translate("Dialog", "<html><head/><body><p align=\"center\"><span style=\" font-size:36pt; color:#ff0000;\">SWISS </span><span style=\" font-size:36pt; color:#ffffff;\">KNIFE </span><span style=\" font-size:12pt;\">v 1.0</span></p><p><span style=\" font-size:36pt;\"><br/></span></p><p align=\"center\"><span style=\" font-size:36pt;\"><br/></span></p></body></html>", None, -1))
        self.label_2.setText(QtWidgets.QApplication.translate("Dialog", "Выберите одну из предложенных функций:", None, -1))

if __name__ == "__main__":
    import sys
    app = QtWidgets.QApplication(sys.argv)
    Dialog = QtWidgets.QDialog()
    ui = Ui_Dialog()
    ui.setupUi(Dialog)
    Dialog.show()
    sys.exit(app.exec_())

mintro1.py:
import sys
from PySide2 import QtCore, QtGui, QtWidgets
from mintro import Ui_Dialog

app = QtWidgets.QApplication(sys.argv)

Dialog = QtWidgets.QDialog()
ui = Ui_Dialog()
ui.setupUi(Dialog)
Dialog.show()

# Здесь предполагаю возможные функции соединения c кнопками

def bincalc():

ui.pushButton.clicked.connect(bincalc)

def weathshow():

ui.pushButton_2.clicked.connect(weathshow)

sys.exit(app.exec_())

weath1.py 

import sys, pyowm
from PySide2 import QtCore, QtGui, QtWidgets
from weath import Ui_Dialog
app = QtWidgets.QApplication(sys.argv)

Dialog = QtWidgets.QDialog()
ui = Ui_Dialog()
ui.setupUi(Dialog)
Dialog.show()

class Weathshow(QtWidgets.QDialog, Ui_Dialog):
    def __init__(self, parent=None):
        super(Weathshow, self).__init__(parent)
        self.setupUi(self)

def get_weather_city():
    owm = pyowm.OWM('API key', language = "ru")
    place = ui.lineEdit.text()
    observation = owm.weather_at_place(place)
    w = observation.get_weather()
    temper = w.get_temperature('celsius')['temp']
    ui.label_2.setText(f"Температура сейчас {temper} по Цельсию.")
    ui.label_3.setText( f"В городе {place} сейчаc {w.get_detailed_status()}.")
    if temper < 10:
        ui.label_4.setText( f"На улице довольно холодно: одевайтесь тепло." )
    elif temper < 20:
        ui.label_4.setText( f"На улице холодно: одевайтесь потеплее." )
    else:
        ui.label_4.setText( f"На улице тепло: одевайтесь свободно." )
ui.pushButton.clicked.connect( get_weather_city )

sys.exit(app.exec_())

my_weath.py
from PyQt5 import QtCore, QtGui, QtWidgets

class Ui_Dialog(object):
    def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(451, 363)
        Dialog.setStyleSheet("background-color:#90d5fc;")
        self.label = QtWidgets.QLabel(Dialog)
        self.label.setGeometry(QtCore.QRect(90, 10, 251, 51))
        self.label.setStyleSheet("font: 9pt \"MV Boli\";")
        self.label.setObjectName("label")
        self.pushButton = QtWidgets.QPushButton(Dialog)
        self.pushButton.setGeometry(QtCore.QRect(260, 130, 141, 51))
        self.pushButton.setStyleSheet("QPushButton {\n"
"color:#2e0ff7;\n"
"background-color:#83f70f;\n"
"border:none;\n"
"font: 12pt \"Niagara Engraved\";\n"
"}\n"
"\n"
"QPushButton:hover {\n"
"    background-color:silver;\n"
"}\n"
"\n"
"QPushButton:pressed {\n"
"    background-color:red;\n"
"}\n"
"")
        self.pushButton.setObjectName("pushButton")
        self.lineEdit = QtWidgets.QLineEdit(Dialog)
        self.lineEdit.setGeometry(QtCore.QRect(22, 70, 381, 41))
        self.lineEdit.setStyleSheet("color:#404dc2;\n"
"border:none;\n"
"background:#77a17b;\n"
"font: 15pt \"Nirmala UI\";")
        self.lineEdit.setObjectName("lineEdit")
        self.label_2 = QtWidgets.QLabel(Dialog)
        self.label_2.setGeometry(QtCore.QRect(10, 190, 431, 51))
        self.label_2.setStyleSheet("color:#db145d;\n"
"font: 75 italic 12pt \"MS Sans Serif\";")
        self.label_2.setText("")
        self.label_2.setTextFormat(QtCore.Qt.PlainText)
        self.label_2.setObjectName("label_2")
        self.label_3 = QtWidgets.QLabel(Dialog)
        self.label_3.setGeometry(QtCore.QRect(6, 240, 441, 51))
        self.label_3.setStyleSheet("color:#db145d;\n"
"font: 75 italic 12pt \"MS Sans Serif\";")
        self.label_3.setText("")
        self.label_3.setObjectName("label_3")
        self.label_4 = QtWidgets.QLabel(Dialog)
        self.label_4.setGeometry(QtCore.QRect(6, 292, 441, 51))
        self.label_4.setStyleSheet("color:#db145d;\n"
"font: 75 italic 12pt \"MS Sans Serif\";")
        self.label_4.setText("")
        self.label_4.setObjectName("label_4")

        self.retranslateUi(Dialog)
        QtCore.QMetaObject.connectSlotsByName(Dialog)

    def retranslateUi(self, Dialog):
        Dialog.setWindowTitle(QtWidgets.QApplication.translate("Dialog", "Dialog", None, -1))
        self.label.setText(QtWidgets.QApplication.translate("Dialog", "Введите город, чтобы узнать погоду:", None, -1))
        self.pushButton.setText(QtWidgets.QApplication.translate("Dialog", "Узнать погоду", None, -1))

if __name__ == "__main__":
    import sys
    app = QtWidgets.QApplication(sys.argv)
    Dialog = QtWidgets.QDialog()
    ui = Ui_Dialog()
    ui.setupUi(Dialog)
    Dialog.show()
    sys.exit(app.exec_())

После того, как программы объединены нужно преобразовать все 
это в .exe файл. Знаю, что с помощью pyinstaller делаются .exe файлы, но что именно из этих трёх преобразовывать в данное расширение?

A:

Ваше основное окно приложения выглядит так:
mintro.py
#from PySide2 import QtCore, QtGui, QtWidgets
from PyQt5 import QtCore, QtGui, QtWidgets

from my_bincalc import Bincalc                                       # из my_bincalc.py
#from my_weathshow import Weathshow                                  # из my_weathshow.py

class Ui_Dialog(object):
    def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(371, 300)
        Dialog.setStyleSheet("background-color:#8430b8;")
        self.pushButton = QtWidgets.QPushButton(Dialog)
        self.pushButton.setGeometry(QtCore.QRect(30, 160, 311, 51))
        self.pushButton.setStyleSheet("color:#d7e535;\n"
"font: 14pt \"Onyx\";\n"
"background-color:#494f8a;")
        self.pushButton.setObjectName("pushButton")
        self.pushButton_2 = QtWidgets.QPushButton(Dialog)
        self.pushButton_2.setGeometry(QtCore.QRect(30, 220, 311, 51))
        self.pushButton_2.setStyleSheet("color:#e01414;\n"
"font: 14pt \"Onyx\";\n"
"background-color:#dff022;")
        self.pushButton_2.setObjectName("pushButton_2")
        self.label = QtWidgets.QLabel(Dialog)
        self.label.setGeometry(QtCore.QRect(0, 30, 371, 51))
        self.label.setStyleSheet("color:#22f70f;\n"
"font: 8pt \"Playbill\";\n"
"border:none;\n"
"")
        self.label.setObjectName("label")
        self.label_2 = QtWidgets.QLabel(Dialog)
        self.label_2.setGeometry(QtCore.QRect(30, 70, 321, 81))
        self.label_2.setStyleSheet("font: 11pt \"MV Boli\";\n"
"")
        self.label_2.setObjectName("label_2")

        self.retranslateUi(Dialog)
        QtCore.QMetaObject.connectSlotsByName(Dialog)

    def retranslateUi(self, Dialog):
        Dialog.setWindowTitle(QtWidgets.QApplication.translate("Dialog", "Dialog", None, -1))
        self.pushButton.setText(QtWidgets.QApplication.translate("Dialog", "Бинарный калькулятор", None, -1))
        self.pushButton_2.setText(QtWidgets.QApplication.translate("Dialog", "Узнать погоду в городе", None, -1))
        self.label.setText(QtWidgets.QApplication.translate("Dialog", "<html><head/><body><p align=\"center\"><span style=\" font-size:36pt; color:#ff0000;\">SWISS </span><span style=\" font-size:36pt; color:#ffffff;\">KNIFE </span><span style=\" font-size:12pt;\">v 1.0</span></p><p><span style=\" font-size:36pt;\"><br/></span></p><p align=\"center\"><span style=\" font-size:36pt;\"><br/></span></p></body></html>", None, -1))
        self.label_2.setText(QtWidgets.QApplication.translate("Dialog", "Выберите одну из предложенных функций:", None, -1))

class Dialog(QtWidgets.QDialog, Ui_Dialog):
    def __init__(self, parent=None):
        super(Dialog, self).__init__(parent)
        self.setupUi(self)

        self.pushButton.clicked.connect(self.bincalc)
        self.pushButton_2.clicked.connect(self.weathshow)   

    def bincalc(self):                                          # бинарный калькулятоp
        print('bincalc')
        self.bincalc = Bincalc()                                # бинарный калькулятоp
        self.bincalc.show()

    def weathshow(self):                                        # прогноз погоды
        print('weathshow')
        #self.weathshow = Weathshow()
        #self.weathshow.show()

if __name__ == "__main__":
    import sys
    app = QtWidgets.QApplication(sys.argv)
#    Dialog = QtWidgets.QDialog()
#    ui = Ui_Dialog()
#    ui.setupUi(Dialog)
#    Dialog.show()
    w = Dialog()
    w.show()
    sys.exit(app.exec_())

ваш модуль, который содержит бинарный калькулятор выглядит так:
my_bincalc.py
#from PySide2 import QtCore, QtGui, QtWidgets
from PyQt5 import QtCore, QtGui, QtWidgets

#from binar import Ui_Dialog
class Ui_Dialog(object):
    def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(452, 360)
        Dialog.setStyleSheet("background-color:#e6fad2;\n"
"")
        self.lineEdit = QtWidgets.QLineEdit(Dialog)
        self.lineEdit.setGeometry(QtCore.QRect(10, 70, 381, 31))
        self.lineEdit.setStyleSheet("color:#1db823;\n"
"font: 10pt \"Tw Cen MT Condensed Extra Bold\";\n"
"background-color:#0a2c40;\n"
"border:none;")
        self.lineEdit.setObjectName("lineEdit")
        self.pushButton = QtWidgets.QPushButton(Dialog)
        self.pushButton.setGeometry(QtCore.QRect(10, 130, 111, 31))
        self.pushButton.setStyleSheet("\n"
"QPushButton {\n"
"\n"
"    color:#f1f52a;\n"
"    font: 8pt \"MS Serif\";\n"
"    font: 11pt \"MS Shell Dlg 2\";\n"
"    background-color:#822af5;\n"
"    border:none;\n"
"}\n"
"\n"
"QPushButton:hover {\n"
"    background-color:silver;\n"
"}\n"
"\n"
"QPushButton:pressed {\n"
"    background-color:red;\n"
"}\n"
"\n"
"\n"
"")
        self.pushButton.setObjectName("pushButton")
        self.lineEdit_2 = QtWidgets.QLineEdit(Dialog)
        self.lineEdit_2.setGeometry(QtCore.QRect(10, 240, 381, 31))
        self.lineEdit_2.setStyleSheet("color:#1db823;\n"
"font: 10pt \"Tw Cen MT Condensed Extra Bold\";\n"
"background-color:#0a2c40;\n"
"border:none;")
        self.lineEdit_2.setObjectName("lineEdit_2")
        self.pushButton_2 = QtWidgets.QPushButton(Dialog)
        self.pushButton_2.setGeometry(QtCore.QRect(10, 300, 111, 31))
        self.pushButton_2.setStyleSheet("\n"
"QPushButton {\n"
"\n"
"    color:#f1f52a;\n"
"    font: 8pt \"MS Serif\";\n"
"    font: 11pt \"MS Shell Dlg 2\";\n"
"    background-color:#822af5;\n"
"    border:none;\n"
"}\n"
"\n"
"QPushButton:hover {\n"
"    background-color:silver;\n"
"}\n"
"\n"
"QPushButton:pressed {\n"
"    background-color:red;\n"
"}\n"
"\n"
"")
        self.pushButton_2.setObjectName("pushButton_2")
        self.label = QtWidgets.QLabel(Dialog)
        self.label.setGeometry(QtCore.QRect(20, 20, 401, 31))
        self.label.setStyleSheet("font: 9pt \"MV Boli\";")
        self.label.setObjectName("label")
        self.label_2 = QtWidgets.QLabel(Dialog)
        self.label_2.setGeometry(QtCore.QRect(20, 190, 411, 31))
        self.label_2.setStyleSheet("font: 9pt \"MV Boli\";")
        self.label_2.setObjectName("label_2")
        self.label_3 = QtWidgets.QLabel(Dialog)
        self.label_3.setGeometry(QtCore.QRect(156, 282, 291, 61))
        self.label_3.setText("")
        self.label_3.setObjectName("label_3")
        self.label_4 = QtWidgets.QLabel(Dialog)
        self.label_4.setGeometry(QtCore.QRect(156, 112, 291, 61))
        self.label_4.setText("")
        self.label_4.setObjectName("label_4")

        self.retranslateUi(Dialog)
        QtCore.QMetaObject.connectSlotsByName(Dialog)

    def retranslateUi(self, Dialog):
        Dialog.setWindowTitle(QtWidgets.QApplication.translate("Dialog", "Dialog", None, -1))
        self.pushButton.setText(QtWidgets.QApplication.translate("Dialog", "Преобразовать", None, -1))
        self.pushButton_2.setText(QtWidgets.QApplication.translate("Dialog", "Преобразовать2", None, -1))
        self.label.setText(QtWidgets.QApplication.translate("Dialog", "    Перевести из десятичной системы исчисления в двоичную:", None, -1))
        self.label_2.setText(QtWidgets.QApplication.translate("Dialog", "    Перевести из двоичной системы исчисления в десятичную:", None, -1))

class Bincalc(QtWidgets.QDialog, Ui_Dialog):
    def __init__(self, parent=None):
        super(Bincalc, self).__init__(parent)
        self.setupUi(self)

        self.pushButton.clicked.connect(self.binarik)
        self.pushButton_2.clicked.connect(self.binarik_2)

    def binarik(self):
        num = int(self.lineEdit.text())
        newNum = ''
        while num > 0:
            newNum = str(num % 2) + newNum
            num //= 2
        self.label_4.setText(newNum)

    def binarik_2(self):
        a = self.lineEdit_2.text()
        def underdef(digit):
            length = len(digit)                   
            helpdig = 0           
            for i in range(0, int(length)):               
                helpdig = helpdig + int(digit[i]) * (2**(int(length) - i - 1))           
            return helpdig  

        self.label_3.setText(str(underdef(a)))

if __name__ == "__main__":
    import sys
    app = QtWidgets.QApplication(sys.argv)
    w = Bincalc()
    w.show()
    sys.exit(app.exec_())

Чтобы собрать .exe файл выполните:
pyinstaller -F -w mintro.py

Все запускайте mintro.exe

