I wrote this code (actually using Jupyter-Notebook):
import random
from ipywidgets import widgets
for ind in range(0,10):
print('Some text'+str(ind))
cb_inner = []
a = random.randint(0,3)
for el in range(0,3):
cb_value = True if el == a else False
A = widgets.Checkbox(value=cb_value, description='cb'+str(el))
cb_inner.append(A)
for_box_list = cb_inner
box = widgets.HBox(for_box_list)
display(box)
print('---'*41)
Now I have text strings and line of chackboxes for each. Only one checkbox active at the time. If I check another checkbox both of them become checked. What I want to do: if I check another checkbox, first one become disabled automatically (for group of checkboxes for every text message).
I suppose I need to create event for this. I found this: Python ipywidgets checkbox events
But I can't understand how to implement it for all my boxes?