Friday, February 11, 2011

Alert boxes in Python?

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.

  • what about this:

    import win32api

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

    Unkwntech : 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
  • 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.

    Unkwntech : That seems like an awful lot of work, and it does not solve teh problem.
    Mikael Jansson : You did not specify the conditions upon which the dialog box would be displayed. I assumed inter-application dependencies.
    Unkwntech : I said I needed to produce an alert box, this does not display an alert.
    Mikael Jansson : 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...

0 comments:

Post a Comment