gpt4 book ai didi

python - 是否可以更改通知的标题?

转载 作者:太空宇宙 更新时间:2023-11-03 19:34:09 24 4
gpt4 key购买 nike

是否可以更改 pynotify.Notification 的标题?如果是的话,要使用什么方法调用?

此外,还可以使用 set_hint_string('append', '') 合并通知。是否可以更改标题并保持它们合并。

我希望发生类似以下的事情(不是真正的代码,只是效果的描述):

Notification("Something is happening") + Notification("Something is happening") -> Notification("2 things are happening")

最佳答案

也许使用update方法:

import pynotify
import time

pynotify.init('app name')
n=pynotify.Notification("title","Something is happening")
n.show()
time.sleep(2)
n.update("new title","2 things are happening")
n.show()

关于python - 是否可以更改通知的标题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4350393/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com