My base code for Pyside

adjust pyside version as needed
#Makin-2021
#python 2.7 pyside2
from PySide2 import QtCore
from PySide2 import QtWidgets
import os
import sys
BASE_DIR = os.path.realpath(sys.argv[0])
if (BASE_DIR.endswith(".py")):
    BASE_DIR = os.path.dirname(BASE_DIR)

class MainGUI(QtWidgets.QMainWindow):
    def __init__(self, parent=None):
        super(MainGUI,self).__init__(parent)
        self.ui_setup_baseframe(self)
        self.show()
    
    #use fr_main and igr_main
    def ui_setup_baseframe(self,MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.setStyleSheet("background-color:black;")
        self.central_widget = QtWidgets.QWidget(MainWindow)
        self.central_widget.setObjectName("central_widget")
        self.igr_central_widget = QtWidgets.QGridLayout(self.central_widget)
        self.igr_central_widget.setObjectName("igr_central_widget")

        MainWindow.setCentralWidget(self.central_widget)

        self.fr_main = QtWidgets.QFrame(MainWindow)
        self.igr_main = QtWidgets.QGridLayout(self.fr_main)
        self.fr_main.setLayout(self.igr_main)

        self.igr_central_widget.addWidget(self.fr_main, 0,0, 1,1, (QtCore.Qt.AlignHCenter|QtCore.Qt.AlignVCenter) )

    def ui_setup_ui(self):




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

    print(BASE_DIR)