Comments (4)
@opoloko thanks for flagging this, I haven't done any extensive testing with JupyterLab or VSCode. After a bit of cursory fiddling this evening, I'm leaning towards the issue being with magic commands (%block
, %blockrun
) working differently in JupyterLab / VSCode versus classic Notebook.
I was able to get this minimal example to work with expected behavior in Jupyterlab:
### cell 1
import ipywidgets as widgets
dropdown = widgets.Dropdown(options=['', 'foo', 'bar', 'baz'])
dropdown
### cell 2
import ipython_blocking
ctx = ipython_blocking.CaptureExecution()
with ctx:
while True:
if dropdown.value:
break
ctx.step()
### cell 3
print("just a string to demonstrate blocking until dropdown changes")
### cell 4
print(dropdown.value)
After a cell -> run all, cells 3 and 4 didn't execute until after I chose an option in the dropdown widget.
I haven't spent a lot of time looking at IPython magic commands outside of classic Notebook. If you have any leads on the differences between classic vs Lab/VSCode, I'd appreciate pointers. Thanks.
from ipython_blocking.
Me too, FWIW...
from ipython_blocking.
@bryceschober I'm afraid I'm having trouble replicating these errors. I just ran the 4-cell example code in both a VSCode (centos7 / python 3.6 / VSCode Python extension) and JupyterLab (Lab 2.2.5, using docker-stacks image, installed @jupyter-widgets from extension manager).
Can you give any more details about system or versions that aren't working for you? Thanks.
from ipython_blocking.
@kafonek Hey, I guess you're right. I must have been doing something else wrong, because I switched a separate notebook to %block dropdown
and it does work... You can go ahead and close this case.
from ipython_blocking.
Related Issues (13)
- 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
- ImportError: cannot import name 'just_run' from 'nbclient.util' HOT 5
- How To Import into Jupyter Notebook HOT 4
- how to block python code execution till js snippet returns in Jupyter notebook HOT 2
- Support reading other properties than value? HOT 3
- [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.