##// END OF EJS Templates
Adding examples from ipython1-dev to docs/examples/kernel. These ...
Adding examples from ipython1-dev to docs/examples/kernel. These examples show how to use IPython for parallel computing. I need to update the import statements and make sure they work with the merged code. But here they are.

File last commit:

r1337:53a3e331
r1337:53a3e331
Show More
helloworld.py
14 lines | 521 B | text/x-python | PythonLexer
"""
A Distributed Hello world
Ken Kinder <ken@kenkinder.com>
"""
from ipython1.kernel import client
tc = client.TaskClient()
mec = client.MultiEngineClient()
mec.execute('import time')
hello_taskid = tc.run(client.Task('time.sleep(3) ; word = "Hello,"', pull=('word')))
world_taskid = tc.run(client.Task('time.sleep(3) ; word = "World!"', pull=('word')))
print "Submitted tasks:", hello_taskid, world_taskid
print tc.get_task_result(hello_taskid,block=True).ns.word, tc.get_task_result(world_taskid,block=True).ns.word