2 ms·
Seems like you just want a global variable that is shared between two cells? current_items = None def generate_numbers(): global current_items
by jaen 6y ago
Seems like you just want a global variable that is shared between two cells?
current_items = None
def generate_numbers():
global current_items
items = []
current_items = items
while True:
items.append(my_item)
return items
def view_current_plot():
plot(current_items)
Note that you probably want to run `generate_numbers()` in a different thread or a different async coroutine so the Jupyter kernel would not block for the duration of it.