title: Autocomplete Kivy Text Inputs from a Text File
body: <p><strong>NOTE:</strong> This is my first time I'm using Overflow, so I'm sorry if the format isn't right :p</p>
  <p><em><strong>Summary:</strong></em>
  Right now my program can save and read information from a Text File thanks to <code>open()</code>
  But I don't know how to get Kivy's Text Inputs to autocomplete based on the Information they read from a Text File.</p>
  <p>I'm looking for a function where as soon as I open the screen, the text inputs are automatically filled in with the information from the file separated by <code>Split()</code></p>
  <p>Here's my Kv File and my Txt File is: <code>DataInfo.text</code></p>
  <pre><code>&lt;CarInfo&gt;:
      name: &quot;carI&quot;
  
      modAuto: modAuto
      colAuto: colAuto
      patAuto: patAuto
  
      GridLayout:
          cols:1
          size: root.width - 200, root.height -200
          pos: 100, 100
  
          GridLayout:
              cols:2
  
              Label:
                  text: &quot;Car Model: &quot;
  
              TextInput:
                  id: modAuto
                  multiline:False
  
              Label:
                  text: &quot;Car Color: &quot;
  
              TextInput:
                  id: colAuto
                  multiline:False
  
              Label:
                  text: &quot;Car patent: &quot;
  
              TextInput:
                  id: patAuto
                  multiline:False
  
          Button:
              text:&quot;Submit&quot;
              size_hint: 0.4, 0.1
              on_press: root.SaveDataInFile()
  
  
          Button:
              text: &quot;Go Back&quot;
              size_hint: 0.4, 0.1
              on_release:
                  app.root.current = &quot;startS&quot;
                  root.manager.transition.direction = &quot;down&quot;
  </code></pre>
  <p>And Here's my <code>Database.py</code> &amp; <code>class CarInfo()</code> in case you need to know:</p>
  <pre><code>class CarInfo(Screen):
      modAuto = ObjectProperty(None)
      colAuto = ObjectProperty(None)
      patAuto = ObjectProperty(None)
  
      def SaveDataInFile(self):
          if self.modAuto.text != &quot;&quot; and self.colAuto.text != &quot;&quot; and self.patAuto.text != &quot;&quot;:
              DB.add_Info(self.modAuto.text, self.colAuto.text, self.patAuto.text)
              confirmacionDatos()
              WM.current = &quot;carI&quot;
  
          else:
              invalidForm() #Pop-Up Screen
  
  # database.py
  class DataBase:
      def __init__(self, filename):
          self.filename = filename
          self.InfoAuto = None
          self.load()
  
      def load(self):
          self.file = open(self.filename, &quot;r&quot;)
          content = self.file.read()
          modAuto, colAuto, patAuto = content.strip().split(&quot;;&quot;) #delimiter
          self.file.close()
  
      def get_Info(self):
          self.file = open(self.filename, &quot;r&quot;)
  
          content = self.file.read()
          modAuto, colAuto, patAuto = content.strip().split(&quot;;&quot;) #delimiter
          self.file.close()
          return modAuto, colAuto, patAuto
  
      def add_Info(self, modAuto, colAuto, patAuto):
          with open(self.filename, &quot;w&quot;) as f:
              f.write(modAuto + &quot;;&quot; + colAuto + &quot;;&quot; + patAuto)
          return 1
  </code></pre>