title: Accesing PyQt Gui elements from another file
body: <p>I am learning PyQt and coming from webdesign, so excuse this question that must have very obvious answer.So I am building a PyQt application and I would like to spread methods to several files to correspond different parts of GUI. How can I access textbox locating in fileA.py from fileB.py. :</p>
  
  <pre><code>#fileA.py
  import sys
  from PyQt4 import QtGui, QtCore
  from gui1 import Ui_MainWindow
  import fileB
  
  class MyApp(QtGui.QMainWindow, Ui_MainWindow):
      def __init__(self):
          QtGui.QMainWindow.__init__(self)
          Ui_MainWindow.__init__(self)
          self.setupUi(self)
  
  
  if __name__ == "__main__":
          app = QtGui.QApplication(sys.argv)
          window = MyApp()
          window.show()
  
          #This works all fine
          def pressed():
              window.plainTextEdit.appendPlainText("Hello")
  
  
          window.pushButton.pressed.connect(pressed)
  
  
          window.button2.pressed.connect(fileB.func3)
          sys.exit(app.exec_())    
  </code></pre>
  
  <p>Now, in this file I would like to use textbox from fileA.py </p>
  
  <pre><code>#fileB.py
  import fileA
  
      #How do I access window.plainTextEdit from fileA.py
  def func3():
      print "hello"
      fileA.window.plainTextEdit.appendPlainText("Hello")
  </code></pre>
  
  <p>What am I doing wrong? What would be best way to spread functionality to multiple files if not this?</p>
  
  <p>Thank you for taking time to read this.</p>