portable way of sending notifying a process

News123 news1234 at free.fr
Sat May 28 19:23:18 EDT 2011


Hi,


I'm looking for a portable way (windows XP / Windows Vista and Linux )
to send a signal from any python script to another one
(one signa would be enough)

I have several python scripts started from different parent processes

occasionally some of the scripts want to tell another to reread it's
config file ( kill -HUP)

It seems, that neither the signals HUP / USR1 are implemented under windows.

What would be a light weight portable way, that one process can tell
another to do something?

The main requirement would be to have no CPU impact while waiting (thus
no polling)

Thanks for any suggestion of small portable libraries or code snippets.


The options, that I found so far seem to be a little too big or not
portable:
- sending the HUP signal doesn't work under win
- inotify doesn't work under win
- pyro seems to be a little too big for such a 'trivial' task
- watchdog might be a solution, but requires
	three other non standard libraries to be installed.
	So I'm not sure it's really lightweight


If nothing exists I might just write a wrapper around
pyinotify and (Tim Goldens code snippet allowing to watch a directory
for file changes)
http://timgolden.me.uk/python/win32_how_do_i/watch_directory_for_changes.html

and use a marker file in a marker directory
but I wanted to be sure of not reinventing the wheel.







More information about the Python-list mailing list