multithreading/multiprocessing with ipywidgets and jupyter notebooks
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
LICENSE
README.md
examples.ipynb
nbmultitask.py
setup.cfg
setup.py

README.md

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.