title: PyQT5 TypeError: startfile: filepath should be string, bytes or os.PathLike, not Ui_MainWindow
body: <p>I'm trying to build an app here. I used QT Designer to build the main window (Ui_MainWindow) with buttons. I import this to a new file where I can structure the code a bit better.</p>
  <p>Anyhow, I keep getting the error &quot;TypeError: startfile: filepath should be string, bytes or os.PathLike, not Ui_MainWindow&quot; whenever I try to get the filename via QFileDialog. This filename is used in the GetData -method to produce a dataframe. I'm sure I'm doing something horribly wrong here in my code. I understood that you can call methods within other methods</p>
  <p>So I will have 3 buttons:</p>
  <ol>
  <li>Open folder (which gets the filename)</li>
  <li>Update data (which is connected to UpdateData method. This method updates the data as I want)</li>
  <li>Calculate (a method that calculates something based on the output from updateData -method.)</li>
  </ol>
  <p>So I am trying to get an output from step 1 to use as input in step 2, to get an output which then would be used as input in step 3 and then - voilá.</p>
  <p>What am I doing wrong?</p>
  <pre><code>from myQTDesignerGUIfile import Ui_MainWindow
  from PyQt5 import QtWidgets
  from PyQt5.QtWidgets import (QApplication, QMainWindow, QPushButton, QLabel, QFileDialog, QMessageBox)
  from PyQt5.QtCore import pyqtSlot, QFileInfo
   
  class MyApp(QtWidgets.QMainWindow, Ui_MainWindow):
      def __init__(self, *args, **kwargs):
          super().__init__(*args, **kwargs)
          
          #Build instance of setpUI in Ui_MainWindow -class
          self.ui = Ui_MainWindow()
          self.ui.setupUi(self)
          
      def GetFileName(self):
          FileFilter = 'File (*.xlsx *.xlsm *.csv)'
          FileName = QFileDialog.getOpenFileName(parent = self,
                                                  caption=&quot;Select File&quot;,
                                                  directory = 'Some Path',
                                                  filter = FileFilter)[0]
          
          path = str(FileName)
          if path:
             print(path)
             return path
  
      def GetData(self):
          path = self.GetFileName
          return pd.read_csv(path)
      
      def UpdateData(self):
          ## get data using the GetData -method
          df = self.GetData()
          
          ## code to modify data is written here
          
          return final_mod_data
  
  if __name__ == &quot;__main__&quot;:
      app = QtWidgets.QApplication(sys.argv)
      w = MyApp()
      w.show()
      app.exec()
  </code></pre>