0

Hello Helpful Journeypeople

I am looking to use GTK with PYGObject to build a GUI to display the contents of a csv file. The thing is, the file is constantly being written to (sub second frequency) and I need to have my window automatically importing changes to the csv file as they come and displaying those changes in the window. So, for example, I would import a csv at one moment and display it as:

gui first import

The window would constantly check to see if there has been a change. When it detects something, the window would automatically update to, say:

gui second import

I'm not sure how to do this. My first thought was to place some code in the gtk.main() loop that checked the csv file and updated the window (to be set off by the 'Start Check' button), but I'm not sure how to do this, or even if this is possible. Please, if you have any advice on how to do this, or any alternative suggestions to this initial idea, I would love to hear from you.

  • Rather than _constantly_ checking, a neater solution would perhaps be to arrange a change event with a file monitor, like so: https://stackoverflow.com/a/1618871/182402 Since you're using PyGObject, you should already have access to the `gio` module. – Wander Nauta Feb 16 '22 at 12:09

0 Answers0