Show More
@@ -587,13 +587,13 b' execution, and will fail with an UnmetDependencyError.' | |||||
587 |
|
587 | |||
588 | In [69]: from IPython.parallel import require |
|
588 | In [69]: from IPython.parallel import require | |
589 |
|
589 | |||
590 | In [70]: @requre('re'): |
|
590 | In [70]: @require('re'): | |
591 | ...: def findall(pat, x): |
|
591 | ...: def findall(pat, x): | |
592 | ...: # re is guaranteed to be available |
|
592 | ...: # re is guaranteed to be available | |
593 | ...: return re.findall(pat, x) |
|
593 | ...: return re.findall(pat, x) | |
594 |
|
594 | |||
595 | # you can also pass modules themselves, that you already have locally: |
|
595 | # you can also pass modules themselves, that you already have locally: | |
596 | In [71]: @requre(time): |
|
596 | In [71]: @require(time): | |
597 | ...: def wait(t): |
|
597 | ...: def wait(t): | |
598 | ...: time.sleep(t) |
|
598 | ...: time.sleep(t) | |
599 | ...: return t |
|
599 | ...: return t |
General Comments 0
You need to be logged in to leave comments.
Login now