Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

micahscopes/nbmultitask

Repository files navigation

nbmultitask

multithreading/multiprocessing with ipywidgets and jupyter notebooks

example usage

The following will return a "control panel" with buttons for starting and monitoring the thread.

from nbmultitask import ThreadWithLogAndControls
from time import sleep
# the target function will be passed a function called `thread_print`
def fn(thread_print):
 i = 1
 # be careful with loops... (in order for the stop button to work)
 while i <= 5:
 thread_print('%i...' % i)
 sleep(1.5)
 i+=1
task = ThreadWithLogAndControls(target=fn, name="do some stuff")
task.control_panel()

Please see the examples.ipynb for more usage examples.

About

multithreading/multiprocessing with ipywidgets and jupyter notebooks

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

AltStyle によって変換されたページ (->オリジナル) /