File Polling (Rereading)

Diez B. Roggisch deets.nospaaam at web.de
Thu Oct 21 10:03:54 EDT 2004


> hmm i'll have to rephrase my question... i KNOW that the file changes
> every 10 seconds... easiest would be i just give you the source code ;)
> the program is a nice little windows which displays ACPI information
> about battery status and stuff like that. the program is working just
> fine. but i want the performance tweak it... 

Why don't you keep the file open, and read until the end - that will give
you all that has been appended since the last read. You might run into
buffering issues here, but you should be able to modifiy the
termios-settings of the filedescriptor so you can read data even if only a
byte has  been send.

-- 
Regards,

Diez B. Roggisch



More information about the Python-list mailing list