Мне нужно обновить метку в kivy с глобальной переменной в python.Как я могу это сделать
Конечный результат, который мне нужен, - обновить позицию холста в соответствии с прерыванием переключателя.
.Py
global x1
def hi():
print "hi"
x1 = 20
print x1
class Mode1(Screen):
global x1
x1 = NumericProperty()
y1 = NumericProperty()
Buttonstatus = ''
ButtonPressed=''
def on_touch_move(self, touch):
print 'x1'
global x1
print x1
hi()
.KV
canvas.after:
Color:
rgb:[1, 0, 0,1]
Rectangle:
pos:root.x1,root.y1
size:20,20