I've got a class defined has the following:
class TData(object) : #Overriden constructor def __init__(self, oc, via ): self.oc = oc self.via = via
now in a separate file I'm trying it iterate through that using recursion.
def search(critia, searchSpace, value) : print "Calling search with " + critia if(len(searchSpace) > 0) : k=0 i = len(searchSpace) k = searchSpace+critia print k search(".ac" , p, 1)
whilst this is not recursion in itself, i'm struggling to understand how to gain access to the class variables. The "a.c" should be appended onto searchSpace. SearchSpace is a list containing objects of TData.
When i do
print searchSpace.ac it works, and I would expect it to. But what I'm trying to acheive at the end of the day is that
search should take a list of parameters - these will be values such as ["ac", "via"] and the recursion will go through each of these values, so far I cant get it to dynamically evaluate the expression
I Hope this makes sense.