Dec-27-2020, 02:48 PM
from kivy.app import App from kivy.lang import Builder from kivy.properties import StringProperty from kivy.uix.textinput import TextInput kv = ''' BoxLayout: orientation: 'vertical' text: newList TextInput: id: newList Button: text: 'click' on_press: app.clicked() ''' class MyApp(App): text = StringProperty('-.text') def build(self): return Builder.load_string(kv) def clicked(self): file = open('-.text', 'r') f = file.readlines() newList = [] for line in f: newList.append(line.strip()) print(newList) self.root.ids.newList.text = (newList) if __name__ == '__main__': MyApp().run()