def byline(fn='kjv.txt'):
    with open(fn) as f:
        for i, _ in enumerate(f):
            pass
return i + 1

def byall(fn='kjv.txt'):
    with open(fn) as f:
        return len(f.readlines())

def bybuf(fn='kjv.txt', BS=100 * 1024):
    with open(fn, 'rb') as f:
        tot = 0
while True:
    blk = f.read(BS)
if not blk:
    return tot
tot += blk.count('\n')
if __name__ == '__main__':
    print(bybuf())
print(byline())
print(byall())
Efficient way to read a specific line number of a file. (BONUS: Python Manual Misprint)