title: Python Kivy: how to call a function on button click?
body: <p>i'm pretty new at using kivy library. </p>
  
  <p>I have an app.py file and an app.kv file , my problem is that I can't call a function on button press.</p>
  
  <p>app.py:</p>
  
  <pre><code>import kivy
  from kivy.app import App
  from kivy.uix.boxlayout import BoxLayout
  from kivy.uix.button import Button
  
  class Launch(BoxLayout):
      def __init__(self, **kwargs):
          super(Launch, self).__init__(**kwargs)
  
      def say_hello(self):
          print "hello"
  
  
  class App(App):
      def build(self):
          return Launch()
  
  
  if __name__ == '__main__':
      App().run()
  </code></pre>
  
  <p>app.kv:</p>
  
  <pre><code>#:kivy 1.9.1
  
  &lt;Launch&gt;:
      BoxLayout:
          Button:
              size:(80,80)
              size_hint:(None,None)
              text:"Click me"
              on_press: say_hello
  </code></pre>