ipython / ipython/ipykernel

javascript to python communication not working properly when "Run All" cells

Offen
#558 2 Kommentare 5 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
734
Forks
412
Ø Merge
1 T. 5 Std.
Gemergte PRs (30 T.)
8

Beschreibung

This issue was first documented [here](https://github.com/jupyter/notebook/issues/1622). I'm going to copy the initial issue comment since it displays a good example.

![image](https://user-images.githubusercontent.com/29098151/97326167-1aba5e00-184a-11eb-95b6-1bcbcfd7ea2f.png)

It turns out that it works well (the last print for num shows 43) but only when I execute this cell by cell. But if I execute it by clicking the "Run All" menu, or by calling in a js file the "notebook.execute_all_cells()" function, the num variable is never modified from the js code.

The idea is that I have some special notebooks where I need to execute every cell when it loads, but some cells depend on a python variable filled from javascript. I've tried to delay the last cell execution time enough so the previous cell is finished, but since the cells execution is linear, I don't think this could solve my problem.

Can someone point me a way on how to do this?

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.