How to make start and stop buttons?

I just tested the timer notebook and the timer button stopping & starting does work in JupyterLab 3.0. Currently launching as described there gives JupyterLab 3.0 if you switch to it in the running session, as described here.

If I understood the workcode bock in your original post, I’m close to the solution at close to solution to widget_example_finish_indicator · GitHub .
What I failed to do was trigger Process finished to print to self.output even though I get the status text below buttons to update at the start and if you press Stop. I tried placing what I thought would do it several places. No luck. I should add that I only tested the behavior in JupyterLab as that is what was mentioned.

I should add that there is also multiprocessing that Python has. I actually have more experience with that than threading personally. If you look at the Module of the week postings for muttiprocessing and threading, you’ll see the coverage is much the same because a lot of the concepts really parallel each other. Importantly, this may tie to the odd behavior of the status because I recalled @glyg had said that the ending the process via threading was behaving weird in the notebook, see here. And so maybe @glyg’s example there would be better adapted for you, sort of what I did from the timer example.

1 Like