将python脚本放入系统托盘的最简单方法是什么(Windows) [英] What's the simplest way to put a python script into the system tray (Windows)

查看:155
本文介绍了将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.

这篇关于将python脚本放入系统托盘的最简单方法是什么(Windows)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆