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