I\'m using a for loop to read a file, but I only want to read specific lines, say line #26 and #30. Is there any built-in feature to achieve this?
Thanks
@OP, you can use enumerate
for n,line in enumerate(open("file")): if n+1 in [26,30]: # or n in [25,29] print line.rstrip()