file parsing/watching + qt

Phil Thompson phil at riverbankcomputing.co.uk
Wed May 4 04:24:52 EDT 2005


> this is a Qt app. app should watch for changes in /var/log/isdn.log and
> on file change (like new line was added to isdn.log) it should activate
> event in my app.
>
> i'm trying to fetch last line in file whenever isdnlog logs something
> so that i can parse that line for a number and store it somewhere else,
> is there a standard solution for this?
>
> i'm using python2.3 on linux with PyQt3.

This is UNIX/Linux specific, but one way would be to use QProcess to run
"tail -f /var/log/isdn.log" and connect the readyReadStdout() signal to
the Python callable that will handle the line.

Phil




More information about the Python-list mailing list