Python 在这种情况下,如何在Windows上获取多个通知?

Python 在这种情况下,如何在Windows上获取多个通知?,python,python-3.x,windows,notifyicon,Python,Python 3.x,Windows,Notifyicon,我有一个问题,不能得到多个弹出式祝酒词在同一时间。我想在Windows通知中获得多个祝酒词,但在这种情况下只有一个支持。我试图使用“FromPyNotifier导入通知”,但结果相同。 我希望在休眠期间使用循环字获得通知的程序。根据我的持续时间设置,祝酒会错过。因此,我将在Windows通知中心获得越来越多的通知计数。 python新手是我。所以,我很感激每一个人。谢谢 from pynotifier import Notification from win10toast import Toas

我有一个问题,不能得到多个弹出式祝酒词在同一时间。我想在Windows通知中获得多个祝酒词,但在这种情况下只有一个支持。我试图使用“FromPyNotifier导入通知”,但结果相同。 我希望在休眠期间使用循环字获得通知的程序。根据我的持续时间设置,祝酒会错过。因此,我将在Windows通知中心获得越来越多的通知计数。 python新手是我。所以,我很感激每一个人。谢谢

from pynotifier import Notification
from win10toast import ToastNotifier
import time
def print_hi(name):
   # Use a breakpoint in the code line below to debug your script.
   print(f'Hi, {name}')  # Press Ctrl+F8 to toggle the breakpoint.


# Press the green button in the gutter to run the script.
if __name__ == '__main__':

   print_hi('Start')
   # 读取文本内容
   file = open("files/test.txt", "r+", encoding="UTF-8")
   text = file.read()
   words = text.split("\n")
   file.close()
   for word in words:
        # sys.stdout.flush()  # 刷新缓冲区
       # Notification(title="Hello Allen", duration=4,urgency=Notification.URGENCY_CRITICAL, description=word).send()
       toaster = ToastNotifier()
       toaster.show_toast("Hello Allen",word,icon_path=None,duration=20,threaded=False)