Python 中的会员通知?
plyer notification in Python?
我在 python 中做了一个断水,它在 ide 中正常工作,它发出通知但是当我使用 pyinstaller 将它变成 .exe 时它应该发出通知崩溃了,谁能帮我解决这个问题?
from plyer import notification
import time
print("Welcome to Water Break")
Timer = int(input("What timer You would I like to keep?"))
print(" thank you will be reminded in",Timer,"mins")
time.sleep(Timer)
title = 'Water Break! '
message = 'it is time a for a WaterBreak'
notification.notify(title=title,
message=message,
app_icon= 'icon.ico',
timeout=10,
toast=True)
是的,因为您需要明确指定隐藏导入
--hidden-import plyer.platforms.win.notification
如果有帮助,请不要忘记投票并标记为已接受的答案
我在 python 中做了一个断水,它在 ide 中正常工作,它发出通知但是当我使用 pyinstaller 将它变成 .exe 时它应该发出通知崩溃了,谁能帮我解决这个问题?
from plyer import notification
import time
print("Welcome to Water Break")
Timer = int(input("What timer You would I like to keep?"))
print(" thank you will be reminded in",Timer,"mins")
time.sleep(Timer)
title = 'Water Break! '
message = 'it is time a for a WaterBreak'
notification.notify(title=title,
message=message,
app_icon= 'icon.ico',
timeout=10,
toast=True)
是的,因为您需要明确指定隐藏导入
--hidden-import plyer.platforms.win.notification
如果有帮助,请不要忘记投票并标记为已接受的答案