title: multiprocessing problem [pyqt, py2exe]
body: <p>I am writing a GUI program using PyQt4. 
  There is a button in my main window
  and by clicking this button.
  I hope to launch a background process 
  which is an instance of a class derived 
  from processing.Process.</p>
  
  <pre><code>class BackgroundTask(processing.Process):
      def __init__(self, input):
          processing.Process.__init__(self)
          ...
  
      def run(self):
          ...
  </code></pre>
  
  <p>(Note that I am using the Python2.5 port
  of the python-multiprocessing obtained
  from 
  <a href="http://code.google.com/p/python-multiprocessing/" rel="noreferrer">http://code.google.com/p/python-multiprocessing/</a>
  that is why it is processing.Process
  instead of multiprocessing.Process.
  I guess this should not make a difference.
  Am I right?)</p>
  
  <p>The code connected to the button click signal 
  is something simply like</p>
  
  <pre><code> processing.freezeSupport()
   task = BackgroundTask(input)
   task.start()
  </code></pre>
  
  <p>The program works as expected under the python intepreter, i.e.
  if it is started from the command line "python myapp.py".</p>
  
  <p>However, after I package the program using py2exe, 
  everytime when I click that button, instead
  of starting the background task, a copy
  of the main window pops up. I am not sure 
  what is the reason of this behavior. I guess
  it is related to the following note addressed
  at 
  <a href="http://docs.python.org/library/multiprocessing.html#multiprocessing-programming" rel="noreferrer">http://docs.python.org/library/multiprocessing.html#multiprocessing-programming</a></p>
  
  <p>"Functionality within this package requires that the <strong>main</strong> method be importable by the children. This is covered in Programming guidelines however it is worth pointing out here. This means that some examples, such as the multiprocessing.Pool examples will not work in the interactive interpreter
  "</p>
  
  <p>The only place I have if <strong>name</strong> == "<strong>main</strong>" is in the main module 
  as in a typical pyqt program</p>
  
  <pre><code>if __name__ == "__main__":
      a = QApplication(sys.argv)
      QObject.connect(a,SIGNAL("lastWindowClosed()"),a,SLOT("quit()"))
      w = MainWindow()
      w.show()
      a.exec_()
  </code></pre>
  
  <p>Any solutions on how to fix this problem? Thanks!</p>