task1.py
17 lines
| 358 B
| text/x-python
|
PythonLexer
Brian E Granger
|
r1338 | from IPython.kernel import client | |
Brian E Granger
|
r1337 | ||
tc = client.TaskClient() | |||
rc = client.MultiEngineClient() | |||
rc.push(dict(d=30)) | |||
cmd1 = """\ | |||
a = 5 | |||
b = 10*d | |||
c = a*b*d | |||
""" | |||
Brian E Granger
|
r1395 | t1 = client.StringTask(cmd1, clear_before=False, clear_after=True, pull=['a','b','c']) | |
Brian E Granger
|
r1337 | tid1 = tc.run(t1) | |
tr1 = tc.get_task_result(tid1,block=True) | |||
tr1.raiseException() | |||
print "a, b: ", tr1.ns.a, tr1.ns.b |