Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #38333

Re: Monitoring updating directory for image for GUI

References <8a572770-9cc1-4b65-9053-10fd6c2f543b@googlegroups.com>
Date 2013-02-07 17:25 +1100
Subject Re: Monitoring updating directory for image for GUI
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.1440.1360218333.2939.python-list@python.org> (permalink)

Show all headers | View raw


On Thu, Feb 7, 2013 at 9:02 AM,  <ciscorucinski@gmail.com> wrote:
> Basically I am creating a program that will stream musical notes into a program called Lilypond one-by-one and it will create the sheet music for that stream of music via OS command. Your understanding of Lilypond is not needed, but you need to know that for each new note that is streamed in "real-time", a PNG image file will be created for that stream of music up to that point...via Lilypond.

I'm surprised nobody has yet responded to this. The list's usually a
lot quicker, heh...

Side point: How real-time can you actually run Lilypond? It usually
takes a bit of time to render a sheet of music. But leaving that
aside.

> What I am looking at doing is to monitor the directory where the image files are being created in real-time, and update the GUI (build with gtk.Builder and Glade) with the most recent image file. I have the program multithreaded and it appears that all of the images are being created sequentially; however, I need to make sure that an older image (an image with less notes displayed) is NOT going to be displayed over a newer image.
>
> The question I have is what do you see as the best way of going about this?

Not sure I fully understand the problem here. Tell me if this workflow
is correct:

* Note comes in
* Lilypond is spawned asynchronously to render the new state
* A new file is created, with a unique name
* Your program shows the latest of these files, no more and no less

Or do you need to sometimes show multiple files?

Can you make use of sequential file naming to ensure that you can
always find the latest file? That way, you just make sure you never
overwrite a displayed image whose name is > than the one you now have.

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Monitoring updating directory for image for GUI ciscorucinski@gmail.com - 2013-02-06 14:02 -0800
  Re: Monitoring updating directory for image for GUI Chris Angelico <rosuav@gmail.com> - 2013-02-07 17:25 +1100
    Re: Monitoring updating directory for image for GUI ciscorucinski@gmail.com - 2013-02-07 16:48 -0800
      Re: Monitoring updating directory for image for GUI Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2013-02-08 02:01 +0000
        Re: Monitoring updating directory for image for GUI ciscorucinski@gmail.com - 2013-02-08 09:09 -0800
          Re: Monitoring updating directory for image for GUI Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2013-02-09 00:53 +0000
          Re: Monitoring updating directory for image for GUI Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-02-08 20:32 -0500
        Re: Monitoring updating directory for image for GUI ciscorucinski@gmail.com - 2013-02-08 09:09 -0800
    Re: Monitoring updating directory for image for GUI ciscorucinski@gmail.com - 2013-02-07 16:48 -0800
  Re: Monitoring updating directory for image for GUI Alain Ketterlin <alain@dpt-info.u-strasbg.fr> - 2013-02-07 11:25 +0100
  Re: Monitoring updating directory for image for GUI Piet van Oostrum <piet@vanoostrum.org> - 2013-02-07 18:11 +0100
  Re: Monitoring updating directory for image for GUI ciscorucinski@gmail.com - 2013-02-11 14:50 -0800
    Re: Monitoring updating directory for image for GUI MRAB <python@mrabarnett.plus.com> - 2013-02-11 23:50 +0000
    Re: Monitoring updating directory for image for GUI Piet van Oostrum <piet@vanoostrum.org> - 2013-02-13 17:09 +0100

csiph-web