title: Python KivyMD - input from one screen, display output in another screen
body: <p>I want to make a 2 page Kivy app - input a word, output definition on another screen. I tried Kivy, it worked. Now I used KivyMD. I encountered NameError.</p>
  <pre><code>   Traceback (most recent call last):
     File &quot;C:/Users/Andrew/PycharmProjects/JesscarlettApp/dictapp.py&quot;, line 94, in &lt;module&gt;
       TestApp().run()
     File &quot;C:\Users\Andrew\PycharmProjects\JesscarlettApp\lib\site-packages\kivy\app.py&quot;, line 950, in run
       runTouchApp()
     File &quot;C:\Users\Andrew\PycharmProjects\JesscarlettApp\lib\site-packages\kivy\base.py&quot;, line 582, in runTouchApp
       EventLoop.mainloop()
     File &quot;C:\Users\Andrew\PycharmProjects\JesscarlettApp\lib\site-packages\kivy\base.py&quot;, line 347, in mainloop
       self.idle()
     File &quot;C:\Users\Andrew\PycharmProjects\JesscarlettApp\lib\site-packages\kivy\base.py&quot;, line 391, in idle
       self.dispatch_input()
     File &quot;C:\Users\Andrew\PycharmProjects\JesscarlettApp\lib\site-packages\kivy\base.py&quot;, line 342, in dispatch_input
       post_dispatch_input(*pop(0))
     File &quot;C:\Users\Andrew\PycharmProjects\JesscarlettApp\lib\site-packages\kivy\base.py&quot;, line 308, in post_dispatch_input
       wid.dispatch('on_touch_up', me)
     File &quot;kivy\_event.pyx&quot;, line 709, in kivy._event.EventDispatcher.dispatch
     File &quot;C:\Users\Andrew\PycharmProjects\JesscarlettApp\lib\site-packages\kivymd\uix\behaviors\ripplebehavior.py&quot;, line 245, in on_touch_up
       return super().on_touch_up(touch)
     File &quot;C:\Users\Andrew\PycharmProjects\JesscarlettApp\lib\site-packages\kivymd\uix\button.py&quot;, line 969, in on_touch_up
       return super().on_touch_up(touch)
     File &quot;C:\Users\Andrew\PycharmProjects\JesscarlettApp\lib\site-packages\kivy\uix\behaviors\button.py&quot;, line 179, in on_touch_up
       self.dispatch('on_release')
     File &quot;kivy\_event.pyx&quot;, line 705, in kivy._event.EventDispatcher.dispatch
     File &quot;kivy\_event.pyx&quot;, line 1248, in kivy._event.EventObservers.dispatch
     File &quot;kivy\_event.pyx&quot;, line 1132, in kivy._event.EventObservers._dispatch
     File &quot;C:\Users\Andrew\PycharmProjects\JesscarlettApp\lib\site-packages\kivy\lang\builder.py&quot;, line 57, in custom_callback
       exec(__kvlang__.co_value, idmap)
     File &quot;&lt;string&gt;&quot;, line 24, in &lt;module&gt;
   NameError: name 'meaning' is not defined
  </code></pre>
  <p>This is my main.py and kv. (please ignore those additional unused modules.)
  The issue is of this line &quot;meaning.text = app.show_data_meaning()&quot; in the kv. But I just don't know how to fix it. Many thanks.</p>
  <pre><code>from kivy.app import App
  from kivymd.uix.screen import Screen
  from kivy.uix.screenmanager import ScreenManager, Screen
  from kivymd.uix.textfield import MDTextField
  from kivy.lang import Builder
  from kivy.uix.label import Label
  from kivymd.uix.button import MDRectangleFlatButton
  from kivy.core.window import Window
  from kivy.uix.image import Image, AsyncImage
  from kivymd.app import MDApp
  from PyDictionary import PyDictionary
  from bs4 import BeautifulSoup as bs
  from kivymd.uix.label import MDLabel
  
  
  class WordScreen(Screen):
      pass
  
  
  class MeaningScreen(Screen):
      pass
  
  
  screen_helper = &quot;&quot;&quot;
  ScreenManager:
      id: screen_manager
      
      WordScreen:
      MeaningScreen:
  
  &lt;WordScreen&gt;
      name: 'wordscreen'
      MDTextField:
          hint_text: &quot;Word&quot;
          id: text_field
          text:'default'
          icon_right: &quot;dictionary&quot;
          icon_right_color: app.theme_cls.primary_color
          pos_hint: {'center_x':0.5, 'center_y':0.9}
          size_hint_x:None
          width:300
      MDRectangleFlatButton:
          text: 'search'
          id: search_button
          pos_hint: {'center_x': 0.5, 'center_y': 0.8}
          on_release: 
              meaning.text = app.show_data_meaning()
              root.manager.current = 'meaningscreen'
              
  &lt;MeaningScreen&gt;
      name: 'meaningscreen'
      MDRectangleFlatButton:
          text: 'back'
          pos_hint: {'center_x': 0.5, 'center_y': 0.2}
          on_release: root.manager.current = 'wordscreen' 
      MDLabel:
          text: &quot;Default&quot;
          id: meaning
          halign: 'center'
          theme_text_color: 'Secondary'
          font_style: 'Body1'
          pos_hint: {'center_x': 0.5, 'center_y': 0.6} 
  
  &quot;&quot;&quot;
  
  class TestApp(MDApp):
      def __init__(self, **kwargs):
          self.title = &quot;Dictionary App&quot;
          self.theme_cls.primary_palette = &quot;Blue&quot;
          super().__init__(**kwargs)
  
      def build(self):
          sm = Builder.load_string(screen_helper)
          return sm
  
      def show_data_meaning(self):
          searchword = self.root.get_screen(&quot;wordscreen&quot;).ids.text_field.text
          print(searchword)
          dictionary = PyDictionary(searchword)
          meaning = dictionary.getMeanings()
          print(meaning)
          return meaning
  
  
  if __name__ == '__main__':
      TestApp().run()
  </code></pre>