📅  最后修改于: 2022-03-11 14:57:09.329000             🧑  作者: Mango
import winrt.windows.ui.notifications as notifications
import winrt.windows.data.xml.dom as dom
nManager = notifications.ToastNotificationManager
notifier = nManager.create_toast_notifier(r"C:\Users\Admin\AppData\Local\Programs\Python\Python38\python.exe")
tString = """
Another Message from Tim!
Hi there!
"""
xDoc = dom.XmlDocument()
xDoc.load_xml(tString)
notification = notifications.ToastNotification(xDoc)
#display notification
notifier.show(notification)