On Mar 24, 7:59 am, Sreejith K <sreejith... at gmail.com> wrote: ... > data is the whole file, but 'less' gives only the two lines... >From this statement (that you are using less), it appears that you are redirecting sys.stdout to a file or similar - if that is the case, you may need to flush or close the output file before it picks up any changes.