title: How to pause Jupyter Notebook widgets, waiting for user input
body: <p>In my notebook I've a loop in which I want to ask the user to binary "Yes" or "No". On this choice the algorithm is suppposed to continue.</p>
  
  <pre><code>for i in range(n_total):
      display.clear_output(wait=True)
      waiting_for_scoring = True
      print("True or False?")
      display.display(widgets.HBox((true_button, false_button)))
      a = true_button.on_click(on_true_button)
      a = false_button.on_click(on_false_button)
      while waiting_for_scoring == True:
          #waiting for user input
          pass
  </code></pre>
  
  <p>How can I make the loop to wait, after the widgets HBox creation, and wait for user input (button click) to continue with the new value answered?</p>
  
  <p>Here's my two functions for the buttons:</p>
  
  <pre><code>def on_true_button(x):
      global waiting_for_scoring
      print('NO!!!!')
      y_new = 1
      waiting_for_scoring = False
      return y_new
  
  def on_false_button(x):
      global waiting_for_scoring
      print('YES')
      y_new = 0
      waiting_for_scoring = False
      return y_new
  </code></pre>
  
  <p>Could you help me to stop the loop until the user presses the button and then use this input? Thank you in advance</p>