text: from kivy.app import App
  from kivy.uix.screenmanager import ScreenManager, Screen
  from kivy.lang.builder import Builder
  from kivy.network.urlrequest import UrlRequest
  from kivy.clock import Clock
  from kivy.uix.label import Label
  
  
  Builder.load_file('kvlang.kv')
  
  class nLabel(Label):
      def __init__(self, **kwargs):
          super().__init__(**kwargs)
          self.size_hint = (1, None)
  
      def on_size(self, *args):
          self.text_size = (self.width - 20, None)
  
      def on_texture_size(self, *args):
          self.text_size = self.texture_size
          x, y = self.texture_size
          self.height += y
  
  class CodigoRequest(Screen):
      def __init__(self, **kwargs):
          super().__init__(**kwargs)
  
      def on_sucess(self, req, request):
          print('SUCESSO')
  
      def on_error(self, req, error):
          print("Error: ", error)
  
      def pega_codigo(self):
          url = 'https://www.google.com'
          codigo = UrlRequest(url, self.on_sucess, self.on_error)
          while not codigo.is_finished:
              Clock.tick()
  
          result = codigo.result
          self.ids.boxCod.add_widget(nLabel(text=str(result)))
  
  
  
  
  telas = ScreenManager()
  telas.add_widget(CodigoRequest(name='codigo_request'))
  
  
  class UrlRequestApp(App):
      def build(self):
          return telas
  
  
  if __name__ == '__main__':
      UrlRequestApp().run()
  