python - Attribute Error Kivy -


i 'm not sure why getting attribute error in following code when try access instance's attribute score:

class ellipsemaker(widget):     score = 10   class modules(gridlayout):     moduleone = objectproperty(none)     def on_touch_down(self,touch):         print self.moduleone.score 

in .kv doc:

<modules>:     cols:1     moduleone: ellipseone     ellipsemaker:         id: ellipseone         size: (root.width/4,root.height/4)         pos: self.parent.center  <ellipsemaker>:    canvas:        ellipse:            pos:self.pos            size:self.size 

the error getting "attributeerror: 'ellipsemaker' object has no attribute 'score'"

the issue had .kv file in ellipsemaker defined, program kept referencing ellipsemaker class instead.


Comments

Popular posts from this blog

python - How to create jsonb index using GIN on SQLAlchemy? -

PHP DOM loadHTML() method unusual warning -

c# - TransactionScope not rolling back although no complete() is called -