使用python中的图像赢得10个toast通知
有没有办法在Windows10中使用python创建交互式toast通知? 目前我正在使用使用python中的图像赢得10个toast通知,python,Python,有没有办法在Windows10中使用python创建交互式toast通知? 目前我正在使用plyer,有时我使用win10toast。 当有人单击它时,我希望它在web浏览器中打开一个页面,并包含图像、图标、文本和用户输入我在for win10toast中搜索,发现它们用于创建windows gui元素,这是最新版本。在那里,您应该能够找到正确的模块来使用图像部分,您可以这样使用模块: import winrt.windows.ui.notifications as notifications
plyer
,有时我使用win10toast
。
当有人单击它时,我希望它在web浏览器中打开一个页面,并包含图像、图标、文本和用户输入我在for win10toast中搜索,发现它们用于创建windows gui元素,这是最新版本。在那里,您应该能够找到正确的模块来使用图像部分,您可以这样使用模块:
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 = """
<toast>
<visual>
<binding template='ToastGeneric'>
<text>Another Message from Tim!</text>
<text>Hi there!</text>
<image placement="appLogoOverride" hint-crop="circle" src="https://picsum.photos/48?image=883"/>
</binding>
</visual>
</toast>
"""
xDoc = dom.XmlDocument()
xDoc.load_xml(tString)
notification = notifications.ToastNotification(xDoc)
#display notification
notifier.show(notification)
将winrt.windows.ui.notifications导入为通知
将winrt.windows.data.xml.dom导入为dom
nManager=notifications.ToastNotificationManager
notifier=nManager.create_toast_notifier(r“C:\Users\Admin\AppData\Local\Programs\Python\Python 38\Python.exe”)
tString=”“”
蒂姆又发了一条短信!
你好!
"""
xDoc=dom.XmlDocument()
加载xml(tString)
通知=通知。ToastNotification(xDoc)
#显示通知
notifier.show(通知)
另外,有三个地方可以放置图像:,和。最好提及一些代码,而不仅仅是链接作者没有提供任何代码,那么我为什么要这样做呢