jupyter / jupyter/notebook

Execution of an individual cell programmatically from its own output button onclick event

Open
#5,572 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
13.3k
Forks
5.8k
Avg merge
6d 11h
Merged PRs (30d)
7

Description

````
from IPython.display import display, Markdown, clear_output
import ipywidgets as widgets
from ipywidgets import Layout

backbutton = widgets.Button(
description="Back",
disabled=False,
icon=''
)

def buttonclicked(_):
with buttonout:
clear_output()
# need code here to execute the current cell

backbutton.on_click(buttonclicked)
`````
This buttonclicked function is actually a python ipywidgets library button's onclick function. This is an ouput of an individual cell. I want to run the same cell once more when I click on this button and get the initial output result. How to do it programmatically from inside the buttonclicked function ?

Contributor guide

Open the contributing guide

Research direction

The payload names no repository files or tests; start by reproducing the Python ipywidgets Button callback in a Jupyter Notebook and trace how the output area and current cell are represented. Done means defining a supported way to rerun only the originating cell from its output button, with its initial output restored.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, python
Domain
developer-experience, frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.