-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
%blockrun button executes even after clicking the button on google colab #8
Comments
@DheerajKN thanks for opening this issue. I'm able to reproduce the issue, and I see this in the javascript console -
I'm not too familiar with what front-end javascript changes Colab makes over generic classic Notebook. Classic Notebook has a
If you know the equivalent Colab front-end API to use, I'm happy to look at this more deeply or review a PR. Thanks. |
I am not much well-versed with using magic functions. Can you provide me the code run magic function from cloned GitHub project? |
Can you try to replace Jupyter with IPython as maybe colab doesn't support Jupyter and instead uses IPython |
@DheerajKN you can test that idea out by going to colab, opening up your browser developer tools, and trying to execute There are two things to research here:
I see that there is a |
if 'google.colab' in str(get_ipython()):
print('Running on CoLab')
else:
print('Not running on CoLab') |
Hi @DheerajKN, Can you please let me know how you finally resolved this in colab? Regards |
@saraswathykrk I couldn't resolve this issue. As we were not able to find an equivalent function for execute_cells_below that is supported in Google Colab. StackOverflow for the same was provided. |
Thanks for the reply @DheerajKN. Did you also try the below code given for Pause Colab Outputs? Just thinking if we could leverage this and achieve the blocking. display(IPython.display.Javascript(''' display(IPython.display.Javascript(''' Regards |
Error reproducible at
cell 1
try:
import ipython_blocking
except ImportError:
!pip install ipython_blocking
import ipython_blocking
cell 2
from ipywidgets import Dropdown, Button, Output
from IPython.display import display, clear_output
outs = Output()
query_selector = Dropdown(
options=['Select', 'Q1', 'Q2'],
value='Select',
description='Query Type:'
)
process_button = Button(
description='Process',
disabled=False
)
def proc_button(bb):
with outs:
clear_output()
display(process_button)
display(query_selector)
query_selector.observe(proc_button, names='value')
display(outs)
cell 3
%blockrun process_button
cell 4
print(query_selector.value)
causing the cell 3 to run continuously even after the button is selected.
The text was updated successfully, but these errors were encountered: