title: Using value from textinput in python
body: <p>I want to make an app which would print text entered in TextInput when I press Print.
  After a couple of hours of searching the web I still can't understand how to assing value of TextInput to variable in python script.</p>
  
  <p>This is Kivy code:</p>
  
  <pre><code>&lt;SimpleRoot&gt;:
      orientation:"vertical"
      padding: root.width * .02, root.height * .02
      spacing: "10dp"
      TextInput:
          id: txt
      Button:
          text: 'Print'
          on_press: root.printTxt(txt.text)
  </code></pre>
  
  <p>Python script:</p>
  
  <pre><code>from kivy.app import App
  from kivy.uix.label import Label
  from kivy.uix.textinput import TextInput
  from kivy.uix.boxlayout import BoxLayout
  
  class SimpleRoot(BoxLayout): # 2
      def printTxt(text):
          print txt.text
  
  
      pass
  
  class SimpleApp(App):  # 1  
      def build(self):
          # Return root widget 
          return SimpleRoot()
  
  if __name__ == "__main__":  
      SimpleApp().run()
  </code></pre>