将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.

其实就是两个问题:

  1. 可以使用 Win32 API 添加托盘图标.示例:SysTrayIcon.py
  2. 隐藏 cmd.exe 窗口就像使用 pythonw.exe 而不是 python.exe 来运行脚本一样简单.立>
  1. Adding a tray icon can be done with Win32 API. Example: SysTrayIcon.py
  2. Hiding the cmd.exe window is as easy as using pythonw.exe instead of python.exe to run your scripts.