Hi. I see one problem. >def wcslow(f): > line = ' ' > c = 0 > while line: > line = f.read(1024) > c += line.count('\n') Your while loop will never execute because line == None. You can fix this by making line equal to "l" or some other string not equal to None.