G'day,
I've got a Raspberry Pi, which will be used to display a transaction log CSV file on an HDMI-connected display. I would like the display to operate as a live 'scoreboard', such that all the user can see is the log CSV file (like an airport/flight announcing board).
I've been told that pyinotify can monitor the log CSV file, and then refresh the file, without having to close and reopen it? I've read through the documentation, and searched the web for this functionality, but I've so far come up empty. I don't have any example code to demonstrate what I've tried (yet!), as I wanted to ascertain first of all whether this functionality is possible with pyinotify, or whether I should be looking at something else.
I'm using Python 3.3.
Any guidance here would be amazing!
Thanks!
Ok, I don't know if it's going to help but here how you can do it:
let's say we have a file :
Than write a script (make sure you point to this file):
run the file:
you will see
than add another line from different terminal to the file (make sure script is still running)
and you will see it on the script output
P.S credit for this code goes to Nicolas Cartot