Thanks all! I think I will stick to my original method because the files can be quite large and without reading the whole file into memory probably enumerate( open( textfile ) ) is the only way to access an arbitrary Nth line.