Hello
again
Sorry I didn't make
the problem I'm working with all too clear. Basically I'm working with a class
(Directory) that upon creation reads in a 3 files and from these files populates
one main list.
This bit is
fine.
The trickier bit was
that I need to use two of the sublists (e.g the contents of two of the files)
outwith the module. I didn't want to read the lists in again as I wanted the
data to be set at the time the Directory class is created. The lists are
accessed from other classes and although I tried passing the instance of
Directory into the new class (Item) but this was causing real problems Item
was trying to read in the lists:
def __init__(self,
filename, **args):
I noted that I
couldn't put my argument for an instance of Directory after **args (presumably
because **args is used to mop up the remaining arguments as a list) and when I
put it before it messed up the reading of the list.
So my code now has
this format-
def GetCategories(self):
#Assign the list values read in via platformCategories and typeCategories
global platformCategories
platformCategories = self.GetPlatformsFile()
global typeCategories
typeCategories = self.GetTypesFile()
#Assign the list values read in via platformCategories and typeCategories
global platformCategories
platformCategories = self.GetPlatformsFile()
global typeCategories
typeCategories = self.GetTypesFile()
The method above is
within Directory and updates the two lists with the values I need. (The methods
called within GetCategories do the returning of the lists.)
I think I've got a
grasp on what was going wrong.
ta
Max
Russell
Senior Test Engineer
Senior Test Engineer
Barco
Bonnington
Bond, 2 Anderson Place, Edinburgh EH6 5NP, UK
Tel + 44 (0) 131 472 5731 Fax +
44 (0) 131 472 4799
www.barco.com
[EMAIL PROTECTED]
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor