wait until change

Tom llafba_NOSPAM_ at gmx.net
Fri Oct 17 14:35:08 EDT 2003


Lane LiaBraaten wrote:

>I would use os.stat() which returns all sorts of info about the file including 
>modification time.
>
>More info at: http://web.pydoc.org/1.5.2/os.html
>
>time=os.stat(file)[8]
>
># analyze data
>
>while 1:
>	if os.stat(file)[8]>time:
>		#analyze data again
>  
>
Hi Lane,

thanks for your answer it works great and gives me a lot of new ideas 
that I can work with.
That "while 1" command looks interessting. I never used while that way. 
The Library Reference doesn't explain it. But am I right if I assume 
that this is  a loop that continues forever? Despite using break of 
course. I ask, because your suggestion works, but unfortunately uses 
100% of my CPU power. :-( Well, it works, but is there maybe another way 
to do the same without using so much of my resources? :-) That would be 
great.

Thank's again.
Tom





More information about the Python-list mailing list