tags:

views:

1294

answers:

2

Is it possible to produce an alert similar to JavaScript's alert("message") in python, with an application running as a daemon.

This will be run in Windows, Most likely XP but 2000 and Vista are also very real possibilities.

Update:
This is intended to run in the background and alert the user when certain conditions are met, I figure that the easiest way to alert the user would be to produce a pop-up, as it needs to be handled immediately, and other options such as just logging, or sending an email are not efficient enough.

+5  A: 

what about this:

import win32api

win32api.MessageBox(0, 'hello', 'title')

This is EXACTLY what I need Thank You.
Unkwntech
For more info on this function I found this: http://docs.activestate.com/activepython/2.4/pywin32/win32api__MessageBox_meth.html
Unkwntech
A: 

Start an app as a background process that either has a TCP port bound to localhost, or communicates through a file -- your daemon has the file open, and then you echo "foo" > c:\your\file. After, say, 1 second of no activity, you display the message and truncate the file.

Mikael Jansson
That seems like an awful lot of work, and it does not solve teh problem.
Unkwntech
You did not specify the conditions upon which the dialog box would be displayed. I assumed inter-application dependencies.
Mikael Jansson
I said I needed to produce an alert box, this does not display an alert.
Unkwntech
Right; I assumed the design choices behind the application was the hardest part, not going to docs.python.org. How did you get 3k+ points...
Mikael Jansson