Thanks for the insights. I solved the problem as follows: I created a
new class method called cleanUp, which resets NStocks to an empty list
and N1 to 0. Works like a charm - it's the first time I've used a
class method, and I immediately see its utility. Thanks again

class Stock(object):
    NStocks = []             #Class variables
    N1         = 0

    @classmethod
    def cleanUp(cls):
        Stocks.NStocks = []
        Stocks.N1 = 0



def simulation(N, par1, par2, idList, returnHistoryDir):

    Stock.cleanUp()
    results = ......
    print results.



-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to