title: Run multiprocessing from a thread
body: <p>Can I run multiprocessing from a thread?. I ask because I have tried, and, it works inside Spyder, however, it does weird things when the EXE file is created.</p>
  
  <p>Weird things like opening multiple GUI's. Here is a relevant piece of code:</p>
  
  <pre><code>class Ui_MainWindow(object):
  
      #class to handle GUI
      #at some point does this
      def startWorker(self):
          self.worker1= WorkerThread()
          self.worker1.start()
  
  class WorkerThread(QtCore.QThread):
       #class to do long hard work without freezing GUI
       def __init__(self, parent=None):
           QtCore.QThread.__init__(self)
           super(WorkerThread, self).__init__(parent)
  
       def run(self):
           p1 = multiprocessing.Process(target=someTraget, args=someArgs)
           p2 = multiprocessing.Process(target=someTarget, args=someArgs)
           p1.daemon = True; p2.daemon = True
           p1.start();p2.start()
  </code></pre>
  
  <p><strong>EDIT: to a comment:</strong></p>
  
  <p>To create the EXE file I am using PyInstaller 2.1 like this:</p>
  
  <pre><code>pyinstaller --onefile --windowed main.py
  </code></pre>
  
  <p>And the calling to my main looks like this:</p>
  
  <pre><code>if __name__ == "__main__":
  
      multiprocessing.freeze_support()
  
      app = QtGui.QApplication(sys.argv)
      MainWindow = QtGui.QMainWindow()
      ui = Ui_MainWindow()
      ui.setupUi(MainWindow)
      MainWindow.showMaximized()
      sys.exit(app.exec_())
  </code></pre>