title: How can I click a pushButton on my PyQt5 code and allow it to execute/run another .py file?
body: <p>I need help in linking a pushButton on my PyQt5 code so that it runs another .py file automatically.</p>
  
  <p>I have tried using 'self.pushButton.clicked.connect' but this does not seem to work on PyQt5 code. I have attached the code for both my .py files below:</p>
  
  <p><strong>main.py</strong></p>
  
  <pre><code>from PyQt5 import QtCore, QtGui, QtWidgets
  class Ui_MainWindow(object):
  def setupUi(self, MainWindow):
      MainWindow.setObjectName("MainWindow")
      MainWindow.resize(519, 354)
      self.centralwidget = QtWidgets.QWidget(MainWindow)
      self.centralwidget.setObjectName("centralwidget")
      self.pushButton = QtWidgets.QPushButton(self.centralwidget)
      self.pushButton.setGeometry(QtCore.QRect(210, 140, 75, 23))
      self.pushButton.setObjectName("pushButton")
      MainWindow.setCentralWidget(self.centralwidget)
      self.retranslateUi(MainWindow)
      QtCore.QMetaObject.connectSlotsByName(MainWindow)
  def retranslateUi(self, MainWindow):
      _translate = QtCore.QCoreApplication.translate
      MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
      self.pushButton.setText(_translate("MainWindow", "Open"))
  
  
  if __name__ == "__main__":
      import sys
      app = QtWidgets.QApplication(sys.argv)
      MainWindow = QtWidgets.QMainWindow()
      ui = Ui_MainWindow()
      ui.setupUi(MainWindow)
      MainWindow.show()
      sys.exit(app.exec_())
  </code></pre>
  
  <p>The above code should produce a window with a single button. When that button is clicked it should execute/run the code below</p>
  
  <p><strong>algorithm.py</strong></p>
  
  <pre><code>arrNumbers = []
  i = 0
  j = 0
  n = 0
  a = 0
  sum = 0
  temp = 0
  print("How many numbers would you like to sort?:", end=' ')
  n = eval(input())
  for i in range(0, n):
      print("Enter Number", i + 1, ":", end=' ')
      a = eval(input())
      arrNumbers.append(a)
  for i in range(1, n):
  for j in range(0, n - i):
      if (arrNumbers[j] &gt; arrNumbers[j + 1]):
          temp = arrNumbers[j]
          arrNumbers[j] = arrNumbers[j + 1]
          arrNumbers[j + 1] = temp
      print()
      print("After pass:",i)
      for k in range(0, n):
      print(arrNumbers[k], end=' ')
      print("[",i + 1, "biggest number(s) is(are) pushed to the end of the list ]")
  print()
  print("It was completed in",i,"passes")
  print("The sorted list using Bubble Sort is: ", end=' ')
  for i in range(0, n):
      print(arrNumbers[i], end=' ')
  </code></pre>
  
  <p>Please can you help me with this issue. I have been searching for solutions but nothing has seemed to work.</p>
  
  <p>Thanks</p>