title: Make Python script wait for button click ipywidgets
body: <p>I'm sorry if this question has already been answered, but I couldn't find anything on here (except this one which hasn't been answered: <a href="https://stackoverflow.com/questions/54629964/how-to-pause-jupyter-notebook-widgets-waiting-for-user-input">link</a> and one that doesn't quite answer the question i'm asking <a href="https://stackoverflow.com/questions/54813069/python-onclick-button-widget-return-object">link</a></p>
  <p>I'm creating a button with ipywidgets, but the script doesn't wait for the button to be clicked. Here's a sample of the code/what I'm trying to achieve:</p>
  <pre><code>button = widgets.Button(description = &quot;Click&quot;)
  output = widgets.Output()
  display(button, output)
  
  def on_button_clicked(b):
       with output:
       print(&quot;button clicked&quot;)
  
  button.on_click(on_button_clicked)
  print(&quot;Python is ignoring you&quot;)
  </code></pre>
  <p>If I run this, I'll just get &quot;Python is ignoring you&quot; before I click the button. I want it to display the button, wait for the person to click it, and only then execute the rest (&quot;Python is ignoring you&quot;).</p>
  <p>Does anyone have an idea of how I can make python wait for the button to be clicked?</p>
  <p>Would appreciate any help! Thanks</p>