title: How to call a function in pyside MainWindow from another python script
body: <p>This is my main.py I have a function called loadShot that I want to call from another </p>
  
  <pre><code>class MainWindow(QMainWindow):
      # Main Window UI
      def __init__(self, parent=None):
          QMainWindow.__init__(self, parent)
          loadUi(os.path.join(SCRIPT_DIRECTORY, 'mainwindow.ui'), self)
  
          self.connectInterface()
  
      # Connect signals
      def connectInterface(self):
          self.scene_Line.textChanged.connect(self.shotName)
          self.activeProjcet_Line.textChanged.connect(self.shotName)
          self.character_Line.textChanged.connect(self.shotName)
          self.take_Line.valueChanged.connect(self.shotName)
          self.load_Button.setShortcut(QKeySequence("Alt+B"))
  
      ####################################################
      #   Shot Loader Functions
      ####################################################
  
  
      def browse(self, dir):
          root = Tkinter.Tk()
          root.withdraw() #use to hide tkinter window
  
          tempdir = tkFileDialog.askdirectory(parent=root, initialdir=dir, title='Please select a directory')
  
          if tempdir.startswith('D:/Capture data/'):
              self.activeProjcet_Line.setText(tempdir)
          elif tempdir.startswith('R:/Project Files/'):
              self.uploadProjcet_Line.setText(tempdir)
              self.uploadFolder()
          else:
              pass
  
      def uploadFolder(self):
          project = self.activeProjcet_Line.text()
          uploadDir = self.uploadProjcet_Line.text()
          f = open('C:/_Mocap/output/folderName.txt', 'w')
          f.write(' \n' + project.replace('D:/Capture data/', '') + '\n' + uploadDir.replace('R:/Project Files/', ''))
          f.close()
  
      def loadShot(self):
          shot = self.shotName_Line.text()
          f = open('C:/_Mocap/output/ShotLoader.txt', 'w')
          f.write('\n' + '[name]\n' + '\n' + 'take Name=' + shot)
          f.close()
          self.uploadFolder()
          if self.incrementTake.isChecked():
              self.takeIncrement()
          else:
              pass
  </code></pre>
  
  <p>This is my other python file that is a key listener and I want to loadShot function. The problem is I keep loading the MainWindow as an instance. Which I cannot do. I need to just be able to call the function in my MainWindow class without loading another instance.</p>
  
  <pre><code>def handle_Ctrl_L ():
      m = MainWindow()
      m.loadShot()
      hk = HotKeys()
      w = WindowMgr()
      pid = w.GetProcessID('Blade')
      w.focusWindow(pid)
      time.sleep(.2)
      hk.F8()
  </code></pre>