I were developing rule based expert systems with experta and the user interface with kivy. The kivy textfield is not accepting the user input, and it can't process, transform and give recommendation for the user, please help me in fixing it
The .kv file is like this, i gave id for all of them
ScreenManager:
Main:
ShortWindow:
<Main>:
name : 'main'
MDLabel:
text: 'Crop Recommendation'
MDLabel:
text: 'Temperature'
pos_hint: {'center_y':0.75}
MDTextField:
id: input_1
on_text_validate:root.textinput(self)
MDLabel:
text: 'weather'
pos_hint: {'center_y':0.68}
MDTextField:
id: input_2
on_text_validate:root.textinput(self)
MDRaisedButton:
id: startbtn
pos_hint: {'center_x':0.5, 'center_y':0.3}
text: 'Get Recommendation'
on_press:
root.recommendation()
app.show_recommendation()
and the .py file is like this and i have tried to call textinput ids and the functions accordingly
class Main(Screen):
input_1 = StringProperty("input_1")
input_2 = StringProperty("input_2")
def textInput(self, widget):
self.input_1 = widget.text
self.input_2 = widget.text
def recommendation(self):
object1 = Set_data(
self.textInput(self.ids.input_1),
self.textInput(self.ids.input_2),
)
object1.data_transform()
preprocess()
engine = Greetings()
engine.reset()
engine.declare(Fact(temp=t))
engine.declare(Fact(weather=w))
engine.run()
print(engine.facts)