Comments (3)
@bryceschober for any kind of situation where you're working with non-standard widgets or have some complex validation (like multiple widgets being filled out), the best thing to do with ipython_blocking is define a function to block on. Basically at every step (kernel.do_one_iteration()
) it will run your blocking function. If the function returns True, it breaks out of the blocking context. If not, it stays in the blocking context.
For FileChooser
, try this out:
### cell 1
import ipyfilechooser
fc = ipyfilechooser.FileChooser()
def block_until_selected():
return bool(fc.selected)
fc
### cell 2
import ipython_blocking
%block block_until_selected
### cell 3
### will not run until a file is selected in cell 1
fc.selected
from ipython_blocking.
Yep, that ended up being simpler, thanks.
from ipython_blocking.
@kafonek After I requested it, ipyfilechooser now inherits from ValueWidget
and implements get_interact_value()
, but that seems to not be enough for ipython_blocking
...
from ipython_blocking.
Related Issues (12)
- Great job! HOT 1
- After %blockrun <button>, notebook jumps to bottom HOT 1
- Kernel.do_one_iteration never awaited HOT 1
- Input prompt numbering in JupyterLab not correct
- Using "Run All" with ipython_blocking leads to unexpected execution order. HOT 1
- How To Import into Jupyter Notebook HOT 4
- how to block python code execution till js snippet returns in Jupyter notebook HOT 2
- Not working in JupyterLab or Visual Studio Code (only in hosted Jupyter Notebook) HOT 4
- [Cross-Posted] ipyfilechooser + ipython_blocking = large memory leak HOT 2
- %blockrun button executes even after clicking the button on google colab HOT 8
- Iām trying to use it within voila HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ššš
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ipython_blocking.