python - Method is being read as attribute? -


I can not use any method in this class Every time I try, I get an error that I do not understand.

  walker (cube) c.move () error: There is no feature of 'move' in walker example   

Here is the code:

  Import as pmym.core pm import random class walker (object): def __init __ (auto, cube): self.cube = cube self.tx = 0 self.ty = 0 self .tz = 0 def move (auto): step_dict = {0: move_x, 1: move_y, 2: move_z} step = random.randint (0,2) self.step_dict [step] () def move_x (self): step_dict = {0: 1, 1: -1} step = random.randint (0,1) attr_value = selt.tx + step_dict [step] pm.setAttr ('% s.translateX'% (self.cube), attr_value) self.tx = attr_value def move_y (self): step_dict = {0: 1, 1: -1} step = random.randint (0,1) attr_value = selt.ty + step_dict [a M] Pm.setAttr ('% s.translateY'% (self.cube), attr_value) self.ty = attr_value def move_z (self): step_dict = {0: 1, 1: -1} step = random.randint ( 0, 1) attr_value = selt.tz + step_dict [step] pm.setAttr ('% s.translateZ'% (self.cube), attr_value) self.tz = attr_value  c   is not an example of     

. Try it: type
  (c)   

to say it

  & lt; class '__main___ walker' & gt;    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -