Re: Watch log

2007-01-16 Thread Salvatore Di Fazio
Michele Simionato ha scritto: > You may begin from this: Tnx Michele -- http://mail.python.org/mailman/listinfo/python-list

Re: Watch log

2007-01-16 Thread Salvatore Di Fazio
Thinker ha scritto: > What you want is something like 'tail -f' in linux. > If you look into it's source code, you will find it check file periodically. > When a read() reach the end of the file, read() will return a empty string. > You can try to read data from the file periodically after a EOF.

Re: Watch log

2007-01-15 Thread Michele Simionato
Salvatore Di Fazio wrote: > Hi guys, > I've an application that writes a log file. > I need to write an application with python that will read this file. You may begin from this: $ cat showlog.py import sys from ScrolledText import ScrolledText interval =50 # ms def displayfile(f, textwidget):

Re: Watch log

2007-01-15 Thread Thinker
Salvatore Di Fazio wrote: > Bjoern Schliessmann ha scritto: > > >> Why not read the file continuously and only do something if a new >> line is complete (i. e. a newline char is detected)? >> > > How can I read the file continuously? > > What you want is something like 'tail -f' in linu

Re: Watch log

2007-01-15 Thread Larry Bates
Salvatore Di Fazio wrote: > Hi guys, > I've an application that writes a log file. > I need to write an application with python that will read this file. > > I would like wait until a new line will be write in the file. > > Something like the "watch cat Log" command on Linux os. > > How can I ch

Re: Watch log

2007-01-15 Thread Salvatore Di Fazio
Bjoern Schliessmann ha scritto: > Why not read the file continuously and only do something if a new > line is complete (i. e. a newline char is detected)? How can I read the file continuously? -- http://mail.python.org/mailman/listinfo/python-list

Re: Watch log

2007-01-15 Thread Bjoern Schliessmann
Salvatore Di Fazio wrote: > I would like wait until a new line will be write in the file. > > Something like the "watch cat Log" command on Linux os. Why not read the file continuously and only do something if a new line is complete (i. e. a newline char is detected)? > How can I check the eof

Watch log

2007-01-15 Thread Salvatore Di Fazio
Hi guys, I've an application that writes a log file. I need to write an application with python that will read this file. I would like wait until a new line will be write in the file. Something like the "watch cat Log" command on Linux os. How can I check the eof and restart the reading? -- ht