> How do I go directly to an exact line number in a file? If the linev length is constant you can use seek() to jump directly by passing N*lineLength Otherwise you have to read N lines: for i in range(N): line = f.readline() If the file is not too big it may be faster to read the whole lot to a list then index the list: lines = f.readlines() line = lines[N-1] # zero indexing Alan g.