title: How can I make a TextInput recognize a dictionary on kivy?
body: <p>My App needs to recognize the user in the first screen to go to the second screen. How can a make a button that only works if the textinput is in a dictionary?
  This Button should be on the screen: 'User'</p>
  <h1>this is my code:</h1>
  <pre><code>from kivy.app import App
  from kivy.base import runTouchApp
  from kivy.lang import Builder
  from kivy.properties import ListProperty
  from kivy.uix.boxlayout import BoxLayout
  from kivy.uix.screenmanager import ScreenManager, Screen, FadeTransition
  import time
  import random
  
  
  '''
  A DICTIONARY AS AN EXAMPLE
  '''
  dic = {}
  dic['a'] = 2
  
  
  class Mapa(Screen):
      pass
  
  class Calendario(Screen):
      pass
  
  class Professores(Screen):
      pass
  
  class Sair(Screen):
      pass
  
  class Usuario(Screen):
      pass
  
  class MyScreenManager(ScreenManager):
      pass
  
  
  root_widget = Builder.load_string('''
  
  #:import FadeTransition kivy.uix.screenmanager.FadeTransition
  
  MyScreenManager:
  
      transition: FadeTransition()
      User:
      Calendario:
      Mapa:
      Professores:
      Sair:
  
  &lt;User&gt;:
      a: _a
      name: 'User'
      FloatLayout:
          Label:
              text: 'User'
              font_size: 50
              size_hint_y: 1.7
              size_hint_x: .95
          GridLayout:
              size_hint_y: 0.08
              size_hint_x: .6
              height: 80
              pos_hint: {'center_x': .5, 'center_y':.6}
              cols: 2
              Label:
                  text: &quot;Login&quot;
                  font_size: 30
              TextInput:
                  id: _a
                  font_size: 30
                  multline: False
          Button:
              text: 'go'
              font_size: 30
              size_hint_y: .1
              size_hint_x: .1
              pos_hint: {'center_x': .5, 'center_y':.4}
              on_release: app.root.current = 'Calendario'
              #if _a in dic:
                  #on_release: app.root.current = 'Calendario'
  
  
  
  
  &lt;Calendario&gt;:
      name: 'Calendario'
  
      BoxLayout:
          orientation: 'vertical'
          Label:
              text: 'Calendario'
              font_size: 30
              size_hint: [1,.2]
  
          BoxLayout:
  
          BoxLayout:
              Button:
                  text: 'Mapa'
                  font_size: 20
                  size_hint: [1,.2]
                  on_release: app.root.current = 'Mapa'
              Button:
                  text: 'Calendario'
                  font_size: 20
                  size_hint: [1,.2]
                  on_release: app.root.current = 'Calendario'
  
              Button:
                  text: 'Professores'
                  font_size: 20
                  size_hint: [1,.2]
                  on_release: app.root.current = 'Professores'
  
              Button:
                  text: 'Sair'
                  font_size: 20
                  size_hint: [1,.2]
                  on_release: app.root.current = 'Usuario'
  
  &lt;Mapa&gt;:
      name: 'Mapa'
  
      BoxLayout:
          orientation: 'vertical'
          Label:
              text: 'Mapa'
              font_size: 30
              size_hint: [1,.2]
  
          BoxLayout:
  
          BoxLayout:
              Button:
                  text: 'Mapa'
                  font_size: 20
                  size_hint: [1,.2]
                  on_release: app.root.current = 'Mapa'
              Button:
                  text: 'Calendario'
                  font_size: 20
                  size_hint: [1,.2]
                  on_release: app.root.current = 'Calendario'
  
              Button:
                  text: 'Professores'
                  font_size: 20
                  size_hint: [1,.2]
                  on_release: app.root.current = 'Professores'
  
              Button:
                  text: 'Sair'
                  font_size: 20
                  size_hint: [1,.2]
                  on_release: app.root.current = 'Usuario'
  
  &lt;Professores&gt;:
      name: 'Professores'
  
      BoxLayout:
          orientation: 'vertical'
          Label:
              text: 'Professores'
              font_size: 30
              size_hint: [1,.2]
  
          BoxLayout:
  
          BoxLayout:
              Button:
                  text: 'Mapa'
                  font_size: 20
                  size_hint: [1,.2]
                  on_release: app.root.current = 'Mapa'
              Button:
                  text: 'Calendario'
                  font_size: 20
                  size_hint: [1,.2]
                  on_release: app.root.current = 'Calendario'
  
              Button:
                  text: 'Professores'
                  font_size: 20
                  size_hint: [1,.2]
                  on_release: app.root.current = 'Professores'
  
              Button:
                  text: 'Sair'
                  font_size: 20
                  size_hint: [1,.2]
                  on_release: app.root.current = 'Usuario'
  
  &lt;Sair&gt;:
      name: 'Sair'
  
      BoxLayout:
          orientation: 'vertical'
          Label:
              text: 'Sair'
              font_size: 30
              size_hint: [1,.2]
  
          BoxLayout:
  
          BoxLayout:
              Button:
                  text: 'Mapa'
                  font_size: 20
                  size_hint: [1,.2]
                  on_release: app.root.current = 'Mapa'
              Button:
                  text: 'Calendario'
                  font_size: 20
                  size_hint: [1,.2]
                  on_release: app.root.current = 'Calendario'
  
              Button:
                  text: 'Professores'
                  font_size: 20
                  size_hint: [1,.2]
                  on_release: app.root.current = 'Professores'
  
              Button:
                  text: 'Sair'
                  font_size: 20
                  size_hint: [1,.2]
                  on_release: app.root.current = 'Usuario'
  
  ''')
  
  class ScreenManagerApp(App):
      def build(self):
          return root_widget
  ScreenManagerApp().run()
  </code></pre>