KV = '''
Screen:
MDRaisedButton:
text: 'button'
pos_hint: {'center_x':.5,'center_y':.4}
on_press: app.func()
MDTextField:
id: text
pos_hint: {'center_x':.5,'center_y':.5}
'''
class Test(MDApp):
def build(self):
return Builder.load_string(KV)
def func():
print(text.text)