Мне нужно написать программу на python, использующую kivy, которая берет текст в текстовое поле и передает его функции, выполняющей очистку веб-страниц, и во многих случаях возвращает массив строк, а последним элементом в массиве является массив пар, поэтомуЯ действительно запутался и отправил много времени. Поэтому я должен написать два файла kv или только один файл?Вот мой простой код для начала.
Я пытался, но он не работает
#textInput.py
from app import *
Builder.load_file('textInput.kv')
require('1.10.0')
class MainScreen(BoxLayout):
def __init__(self):
self.super(MainScreen, self).__init__()
def btn_click(self):
name =self.BoxLayout.BoxLayout.TextInput
#the function that takes the output of the text field
get_company_name(name)
#
#
#
# here I will call the function that returns the array so how to pass the answer
# and also pass to where ? shall I use the same kv file or create another one
class Test(App):
def build(self):
self.title = 'CompanyInfoApp'
return MainScreen()
if __name__ == '__main__':
Test().run()
lbl: My_label ориентация: 'вертикальный'
# Third section title
Label:
size_hint: (1, .1)
text: 'Welcome To compnay info App'
font_size: 25
# Third section Box
BoxLayout:
Button:
text:"let's start"
on_press:root.btn_click()
size_hint: (1, .2)
padding: [180, 180, 180, 180]
BoxLayout:
Label:
pos_hint:{'x': .3, 'y': .6}
text: 'Enter the Company Name:'
text_size: self.width-20, self.height-20
TextInput:
height: self.minimum_height
pos_hint:{'x': .3, 'y': .6}
multiline: False
text: ''