Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jul 23rd, 2012  |  syntax: Python  |  size: 0.39 KB  |  views: 47  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. from IPython.parallel import Client
  2. import multiprocessing
  3.  
  4. class SubProc(multiprocessing.Process):
  5.     def __init__(self, name):
  6.         multiprocessing.Process.__init__(self, name=name)
  7.  
  8.     def run(self):
  9.         my_client = Client()
  10.  
  11. if __name__ == '__main__':
  12.     client = Client()
  13.     print "There are %d engines." % len(client.ids)
  14.     proc = SubProc("blah")
  15.     proc.start()