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()
buran write Dec-27-2020, 04:41 PM:
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.
