python中的咆哮通知

2024-05-16 19:03:24 发布

您现在位置:Python中文网/ 问答频道 /正文

在python中使用Growl,但是没有任何出现的运气。使用以下代码。在OSX Lion上运行Growl1.3.3。有人用这个吗?在

import Growl

notifier = Growl.GrowlNotifier(applicationName='mzgrowl', notifications=['alive'])
notifier.register()
notifier.notify('alive', 'mzgrowl', 'test message')

Tags: 代码testimportregisternotifynotificationsnotifierosx
2条回答

这是另一个与Growl1.2兼容的解决方案。我没有1.3来测试。它比大多数浮动的解决方案都好,因为你不必打开growl网络。在

来自http://wiki.python.org/moin/MacPython/Growl/AppleScriptSupport

$ pip install appscript

然后运行这个:

^{pr2}$

{这是一个新的python绑定库}

你可能会有更好的运气。在

相关问题 更多 >