B.G.R. wrote: > numline=0 > for line in sys.stdin: > numline+=1 > workwithline(line) I'd use: for numline, line in enumerate(sys.stdin): workwithline(line) Note: The line numbers start at 0, but that is often acceptable. --Scott David Daniels Scott.Daniels at Acm.Org