You need to build a Windows SysTray App/Service using the Python for Windows Extensions
Please see similar question: How to build a SystemTray app for Windows?
This is by no means trivial, so please feel free to post follow-up questions of a more specific nature!
Update:
You may also find this 3rd-party module quite useful that seems to implement the hardest part of this for you as a reuseable library:
https://github.com/Infinidat/infi.systray
Example using infi.systray
:
from infi.systray import SysTrayIcon
def say_hello(systray):
print "Hello, World!"
menu_options = (("Say Hello", None, say_hello),)
systray = SysTrayIcon("icon.ico", "Example tray icon", menu_options)
systray.start()
Looking at the source code for infi.systray
the nice thing about it is that it doesn't depend on pywin32
. It uses ctypes
which is available as part of the standard Python library.