我有一个标签和一个文本输入,我想通过.py文件上的一个变量来更改它的文本属性。 代码如下:
<DefinicaoDeSaidas>:
BoxLayout:
orientation:'vertical'
BoxLayout:
orientation:'vertical'
padding: 0,20,20,50
Image:
source:'exemplo.png'
Label:
text:'Escolha as missoes para a saida'
font_size:40
TextInput:
id: ti
class DefinicaoDeSaidas(Screen):
#get the values and everything
#transformate a variable ('name') onto the ti.text property
您可以通过github存储库查看所有代码:https://github.com/Enzodtz/FLL-Artificial-Inteligence
不要在.py中使用id,因为它通常会导致出现类似
foo_object.ids.ti
的代码,相反,您可以将其作为属性公开:然后您可以从任何方法使用self进行访问:
相关问题 更多 >
编程相关推荐