为什么pync不适合Mac不起作用? (Python)
我正在尝试在Mac上使用Python进行通知。我已经安装了PYNC,并使用了以下代码:
from plyer import notification
import pync, time
while True:
pync.notify("lets do something random!")
print("Activated!")
time.sleep(1)
Visual Studio代码调试器显示了这一点:
Activated!
Activated!
Activated!
但是,没有显示通知。我已经启用了通知,横幅和声音。为什么通知不显示?提前致谢!
I'm trying to do notifications in python on mac. I have installed pync, and used the following code:
from plyer import notification
import pync, time
while True:
pync.notify("lets do something random!")
print("Activated!")
time.sleep(1)
The visual studio code debugger shows this:
Activated!
Activated!
Activated!
However, no notification shows up. I have enabled notifications, with banner and sounds. Why does the notification not display? Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,它对我在MacOS 12.3.1上有用,
请确保您从终端通知器允许的通知:
系统首选项 - >通知&焦点 - >终端运动
并允许通知
,可能是您在Mac上禁用的通知,例如您处于“焦点”模式
Yes, it works for me on MacOS 12.3.1
Make sure you have notification from terminal-notifier allowed:
System Preferences -> Notifications & Focus -> terminal-notifier
and allow the notifications
Also, it might be the case that you have notifications disabled on your mac e.g. you're in "focus" mode