##// END OF EJS Templates
client.run is now like %run, not TaskClient.run
client.run is now like %run, not TaskClient.run

File last commit:

r3609:8d078bcc
r3620:5bcc9665
Show More
job_wrapper.py
25 lines | 550 B | text/x-python | PythonLexer
#!/usr/bin/env python
"""Python wrapper around a submitted workflow job.
In reality this would be a more sophisticated script, here we only illustrate
the basic idea by considering that a submitted 'job' is a Python string to be
executed.
"""
import sys
argv = sys.argv
from IPython.zmq.parallel.engine import EngineFactory
from IPython.zmq.parallel.ipengineapp import launch_new_instance
ns = {}
# job
exec sys.argv[1] in ns
# this should really use Config:
EngineFactory.user_ns = ns
# start engine with job namespace
launch_new_instance()