Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > file parsing/watching + qt

Reply
Thread Tools

file parsing/watching + qt

 
 
aljosa
Guest
Posts: n/a
 
      05-04-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.


Aljosa

 
Reply With Quote
 
 
 
 
Phil Thompson
Guest
Posts: n/a
 
      05-04-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

 
Reply With Quote
 
 
 
 
Swaroop C H
Guest
Posts: n/a
 
      05-04-2005
On 3 May 2005 22:43:02 -0700, aljosa <(E-Mail Removed)> wrote:
> 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.


Use the Python binding to FAM (File Alteration Monitor):
http://python-fam.sourceforge.net/


HTH,
--
Swaroop C H
Blog: http://www.swaroopch.info
Book: http://www.byteofpython.info
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting JPG file ppt file [Powerpoint] file zxcvar Digital Photography 7 06-22-2009 07:54 PM
Reading of file by next of map file and by next of file descriptor. =?ISO-8859-2?Q?Miros=B3aw?= Makowiecki C++ 1 07-10-2007 02:46 AM
How to create MDF file (.mdf) file from XML file. Dave ASP .Net 1 06-07-2007 11:32 PM
In file parsing, taking the first few characters of a text file after a readfile or streamreader file read... .Net Sports ASP .Net 11 01-17-2006 12:44 AM
An Automated process of watching a network file folder, reading a file in it and deleting the file using ASP.NET ? Luis Esteban Valencia Muņoz ASP .Net 3 06-04-2005 10:56 AM



Advertisments