Re: Storing records from a parsed file

2006-09-30 Thread Ben
Finally got it all sorted :-) I got slightly confused because it seems that if you refer to class variables from methods within that class you need to explicitly state that they are self, otherwise, since class variables are all public in python, things could get quite confusing. Ben Ben wrote:

Re: Storing records from a parsed file

2006-09-30 Thread Ben
Ah - I think I've sorted it out. I can now have data1.function() or data2.function() etc However, I can still call function() directly: function() which seems very odd Indeed. The only instances of function are within classes data1 and data2, and these definitions are different, so I don'

Re: Storing records from a parsed file

2006-09-30 Thread Ben
Ah I see. So istead of creating the classes diectly I use a facroty class as a buffer - I tell it what I want and it makes the appropriate instances. I am not enitely sure that applies here though (I may be wrong) Currently I have: camera_list[] class camera: def __init__(self,alpha,beta,ga

Re: Storing records from a parsed file

2006-09-30 Thread Steve Holden
Ben wrote: > Apologies if this is te wrong place to post - I realise the question > is pretty basic... > > I have a simple python script that parses a text file and extracts data > from it. Currently > this data is stored in a list by a function, each element of which is > an instance of a class

Storing records from a parsed file

2006-09-30 Thread Ben
Apologies if this is te wrong place to post - I realise the question is pretty basic... I have a simple python script that parses a text file and extracts data from it. Currently this data is stored in a list by a function, each element of which is an instance of a class with member variables to