[CentralOH] Code to Refactor

jep200404 at columbus.rr.com jep200404 at columbus.rr.com
Tue May 15 17:41:51 CEST 2012


What's a better way of doing the following? 
Iterators come to mind, but the need to get a 
variable lengths seems to screw that up. 

class dribbler():
    def __init__(self, s):
        self.s = s
        self.i = 0

    def get_next_n(self, n):
        s = self.s[self.i:self.i + n]
        self.i += n
        return s



More information about the CentralOH mailing list