
def buffer( fp, bs = 8192):
    while 1:
        data = fp.read( bs)
        if data == '': break
        yield data


fp = open('tmp/decorator.py','r')

for data in buffer( fp, 40):
    print data

