Read file from bottom

Julia Bell julia.bell at jpl.nasa.gov
Mon May 13 16:49:46 EDT 2002


Good idea; I never thought of something like that.

My initial reaction is that I don't know I exactly how many lines frm the
bottom I want.  (I currently read the lines, search for data on the lines
that meets some trigger criterion, and then start processing the data from
there.)  But, there still might be something worth thinking about regarding
whether it is more efficient to pre-process the data (similar to using
'tail') than to process it as part of my script.

Thanks.

Julia Bell


William Park wrote:

> Julia Bell <julia.bell at jpl.nasa.gov> wrote:
>
> >
> > Is there an efficient (and relatively easy - I'm new to Python) way of
> > reading the file from the last line backward instead of the first line
> > forward?
>
>
> tail | python script.py
>
> --
> William Park, Open Geometry Consulting, <opengeometry at yahoo.ca>
> 8-CPU Cluster, Hosting, NAS, Linux, LaTeX, python, vim, mutt, tin




More information about the Python-list mailing list