Search code examples
pythonwindowstaskbar

Is there a way to make a Python console application flash in the taskbar in Windows?


Is there a way to make my Python console application's window flash in the Windows taskbar, to get a user's attention?

My script will be run exclusively in a relatively homogeneous Windows environment, so I don't care about detecting whether a particular API is present, or whether a solution is cross-platform or not (of course cross-platform is better for future reference... but I don't need it for this application).


Solution

  • Flashing the taskbar in Windows is accomplished using the FlashWindowEx API function (Python API help).

    I haven't tried this myself, but it should be possible to call this function from Python using PyWin32 (Python for Windows extensions) that can either by installed manually or by installing ActivePython.