Re: How best to reference parameters.

2005-10-26 Thread David Poundall
Sorry Ron, my earlier reply was too brief I wasn't thinking straight (so what else is new ;-) my apologies. The main reason for going down the route I am looking at (thread 2) is that intellisense runs OK in my IDE using that aproach. In my application this will be important as I will be using t

Re: How best to reference parameters.

2005-10-26 Thread Ron Adam
David Poundall wrote: > Sadly Ron, c_y can only see index and showall in your example. Well, don't give up! The approach is sound and I did say it was untested. Here's a tested version with a few corrections. :-) Cheers, Ron class Pump(object): def __init__(self, name, ptype, n

Re: How best to reference parameters.

2005-10-26 Thread Istvan Albert
Sounds like the Bunch: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52308 -- http://mail.python.org/mailman/listinfo/python-list

Re: How best to reference parameters.

2005-10-26 Thread David Poundall
Sadly Ron, c_y can only see index and showall in your example. -- http://mail.python.org/mailman/listinfo/python-list

Re: How best to reference parameters.

2005-10-26 Thread Ron Adam
David Poundall wrote: > However, what I really would like is something like... > > class c_y: > def __init__(self): > self.P1 = [0, 'OB1', 0 ] > self.P2 = [0, 'OB1', 1 ] > self.P3 = [0, 'OB1', 2 ] > self.P4 = [0, 'OB1', 3 ] > > Because that way I can also hol

Re: How best to reference parameters.

2005-10-26 Thread David Poundall
Nice - I like that Tony. I had seen it around before but I didn't catch on. Thanks for the clear example.. -- http://mail.python.org/mailman/listinfo/python-list

Re: How best to reference parameters.

2005-10-25 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, "David Poundall" <[EMAIL PROTECTED]> wrote: > I am writing a scada package that has a significant amount of user > defined parameters stored in text files that I wish to cleanly access > in code. By way of an example, a few lines from the configuration file > woul

Re: How best to reference parameters.

2005-10-25 Thread Jay Parlar
On Oct 25, 2005, at 3:10 PM, David wrote: > > It looks like I am going to have to bite the bullet and use properties. > The following should do what I want. > > class test: > > def __init__(self): > self.__HB = 0 > self.__VPG = 0 > ... FYI, for property to work, your class ha

Re: How best to reference parameters.

2005-10-25 Thread David Poundall
It looks like I am going to have to bite the bullet and use properties. The following should do what I want. class test: def __init__(self): self.__HB = 0 self.__VPG = 0 def _get_HB(self): return (self.__HB, 'MF1', 0) def _set_HB(self, x): self.__HB = x HB = prope

How best to reference parameters.

2005-10-25 Thread David Poundall
I am writing a scada package that has a significant amount of user defined parameters stored in text files that I wish to cleanly access in code. By way of an example, a few lines from the configuration file would typically be ... [Plant Outputs] Y0 P1 Pump 1 Pressure Y1 P2 Pu