[pygtk] way to tail a log file to a veiwer

Volker Helm Helm.volker at gmx.de
Thu Feb 1 04:07:05 WST 2007


Hi,

define the amount of lines your will show. i.e. 25 lines.
First I'd open the log file with mode 'r+'. 
Second, loop through the file an get every line with readline into the array, but after 25 lines, delete the first line with array.pop(i). Remember the last position.

Third after the loop ended join the array and put into the textview.
For refresh create a button or use a timer, which start at the end of the file and loops through till the end again.

Little complicated, but I don't now a function like tail in python.

Bye,

Volker


-------- Original-Nachricht --------
Datum: Wed, 31 Jan 2007 12:38:43 -0600
Von: "shawn bright" <nephish at gmail.com>
An: pygtk-list <pygtk at daa.com.au>
CC: 
Betreff: [pygtk] way to tail a log file to a veiwer

> lo there,
> 
> i am looking for an easy way to tail a log file and pipe its output to a
> text view.
> 
> any ideas ?
> 
> sk

-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer


More information about the pygtk mailing list