From: Marc D. <ma...@op...> - 2009-08-06 15:34:49
|
On Thu, Aug 6, 2009 at 9:57 AM, william ratcliff <wil...@gm... > wrote: > Yes, I could use properties which would then trigger get and set methods so > that I > could do something like motor4.position=3 > > If I was clever, I could even make a motor class and have individual motors > inherit from it. But, this presents a few problems, first I really don't > want to define our 148+ motors (which all have creative names) this way. > But this is Python — you'd define __getattr__ and __setattr__ methods to let you write: mv.SampleSlit=30 or mv.motor4=10 That has the same number of characters as mv SampleSlit 30. Marc. |