将python脚本放入系统托盘的最简单方法是什么(Windows)
问题描述:
将python脚本放入系统托盘的最简单方法是什么?
What's the simplest way to put a python script into the system tray?
我的目标平台是 Windows.我不想看到cmd.exe"窗口.
My target platform is Windows. I don't want to see the 'cmd.exe' window.
答
其实就是两个问题:
- 可以使用 Win32 API 添加托盘图标.示例:SysTrayIcon.py
- 隐藏
cmd.exe
窗口就像使用pythonw.exe
而不是python.exe
来运行脚本一样简单.立>
- Adding a tray icon can be done with Win32 API. Example: SysTrayIcon.py
- Hiding the
cmd.exe
window is as easy as usingpythonw.exe
instead ofpython.exe
to run your scripts.