title: Return output of the function executed 'on_click'
body: <p>How to get the output of the function executed <code>on_click</code> by <code>ipywidgets.Button</code> 
   outside the function to use in next steps? For example, I want to get back the value of <code>a</code> after every click to use in the next cell of the jupyter-notebook. So far I only get <code>None</code>.</p>
  
  <pre><code>from ipywidgets import Button
  def add_num(ex):
      a = b+1
      print('a = ', a)
      return a
  
  b = 1
  buttons = Button(description="Load/reload file list")
  a = buttons.on_click(add_num)
  display(buttons)
  print(a)
  </code></pre>