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:
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'
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
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
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