title: How can I display terminal output to a text box in PyQt
body: <p>I'm coding a GUI which has a function that prints output to terminal. I would like to have it shown in some kind of text box or something similar.</p>
  
  <p>Code looks like this:</p>
  
  <pre><code>def radial_distance(body1, body2, utc, ref, abcorr, obs):
      x_1 = 1
      x_2 = 4
      y_1 = 5
      y_2 = 2
      z_1 = 7
      z_2 = 6
  
      d_rad = np.sqrt((x_2 - x_1)**2.0 + (y_2 - y_1)**2.0 + (z_2 - z_1)**2.0)
  
      return d_rad
  </code></pre>
  
  <p>I've tried Text Label but I need more space to print (need to scroll down). Also tried Text Browser and Text Edit but didn't find the way to display it.</p>
  
  <p>PyQt thing looks like:</p>
  
  <pre><code>from Distances import radial_distance
  from PyQt5 import QtCore, QtGui, QtWidgets
  
  
  class Ui_window1(object):
      def setupUi(self, window1):
          window1.setObjectName("window1")
          window1.resize(485, 530) # 820 530
          self.centralwidget = QtWidgets.QWidget(window1)
          self.centralwidget.setObjectName("centralwidget")
          self.output_rd = QtWidgets.QTextBrowser(self.groupBox_2)
          self.output_rd.setGeometry(QtCore.QRect(10, 90, 331, 111))
          self.output_rd.setObjectName("output_rd")
  
  def retranslateUi(self, window1):
          _translate = QtCore.QCoreApplication.translate
          window1.setWindowTitle(_translate("window1", "GUI"))
  
   def rad_distance(self):
          time_rd = np.asarray(self.get_time_rd())
  
          body1, body2 = ['EARTH', 'SUN']
  
          rad_dis = radial_distance(body1, body2, time_rd, 'HCI', 'NONE', 'SUN')
  
          self.output_rd.setText(rad_dis) # This doesnt work
  
  if __name__ == "__main__":
      import sys
      app = QtWidgets.QApplication(sys.argv)
      window1 = QtWidgets.QMainWindow()
      ui = Ui_window1()
      ui.setupUi(window1)
      window1.show()
      sys.exit(app.exec_())
  </code></pre>
  
  <p>Could you help me out? Thanks!</p>