I'm making a scraper/web crawler using Kivy when I run the code it works but I'm not sure if what I'm doing is Pythonic because all the language I can find is about using the Kivy library. I'm unsure about putting the functions to bind the widgets to inside the build method. Is there a better way?

class MainApp(App):

def build(self):
root = RootWidget()
c = CustomLayout()

search_term = TextInput(
text='',
size_hint=(.5, .05),
pos=(250, 15))

def on_enter(self):
scrape = Scrape(search_term.text, ['user_agent','chrome'])