我在寻找更改pystray托盘通知标题的方法时遇到问题。看起来它从某个地方获取了默认值“Python”。见下图:
在文档中,没有额外的参数来更改通知图标标题。如何找到一种方法将标题值更改为我想要的值?
这是一个工作代码示例:
from tkinter import *
from pystray import MenuItem as item
from PIL import Image, ImageTk
from res import * #here is my base64 encoded icon. Variable icon_base64.
from base64 import b64decode
import pystray
import base64
pic=ImageTk.BytesIO(icon_base64) #transfering base64 to bytes
def run_icon():
#image = Image.open("icon.ico") #uncomment this to use a standard image, isntead of base64.
title="Tray title"
image=Image.open(pic) #comment this if using standard way of image
menu = (item('test1', lambda: show(),default = True), item('Exit', …Run Code Online (Sandbox Code Playgroud)