title: Apps in Kivy: get values in kv file
body: <p>I am new to programming with Kivy, I'm trying to develop a program that collects the number of people in a room.</p>
  
  <p>And my difficulty is to pass values between KV file and the main. I need to get the value of the slider which is in KV file and use it in main.py program</p>
  
  <p>How could it? already I tried several ways that were posted on different topics here on the site but could not. Perhaps because as I have no knowledge in the area did not know apply it right. </p>
  
  <pre><code>from kivy.app import App
  from kivy.uix.screenmanager import ScreenManager, Screen
  from kivy.properties import NumericProperty, ObjectProperty
  from kivy.lang import Builder
  
  class ThemeBackground(Screen):
      pass
  
  class myApp(App):
  
      def build(self):
          root = ScreenManager()
          root.add_widget(ThemeBackground(name='Screen'))
          return root
  
  if __name__ == '__main__':
      myApp().run()
  </code></pre>
  
  <p>And Kv file</p>
  
  <pre><code>#:import random random.random
  
  &lt;ThemeBackground&gt;:
      orientation: 'vertical'
      canvas:
          Color:
              rgb: 1, 1, 1
          Rectangle:
              source: 'data/images/background.jpg'
              size: self.size
  
      BoxLayout:
          padding: 10
          spacing: 10
          size_hint: 1, None
          pos_hint: {'top': 1}
          height: 44
          Image:
              size_hint: None, None
              size: 24, 24
              source: 'data/logo/kivy-icon-24.png'
          Label:
              height: 24
              text_size: self.size
              color: (1, 1, 1, .8)
              text: 'Kivy 1.9.0.'
              valign: 'middle'
  
      GridLayout:
          cols: 2
          Label:
              text: 'Please enter \nthe number of occupants?'
              bold: True
              font_name: 'data/fonts/DejaVuSans.ttf'
              font_size: 22
              halign: 'center'
  
          Slider:
              id: slider
              min: 0.0
              max: 15.0
              value: 1.0
              step: 1.0
              orientation: "horizontal"
              width: "38dp"
  
          Label
              text: ''
  
          Label
              text: '{}'.format(slider.value)
              halign: 'center'
              valign: 'top'
              bold: True
              text_size: self.size
              font_size: 18
  
      Button:
          text: 'Enter'
          size_hint_y: None
          height: '50sp'}
  </code></pre>