Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/287.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用python中的图像赢得10个toast通知_Python - Fatal编程技术网

使用python中的图像赢得10个toast通知

使用python中的图像赢得10个toast通知,python,Python,有没有办法在Windows10中使用python创建交互式toast通知? 目前我正在使用plyer,有时我使用win10toast。 当有人单击它时,我希望它在web浏览器中打开一个页面,并包含图像、图标、文本和用户输入我在for win10toast中搜索,发现它们用于创建windows gui元素,这是最新版本。在那里,您应该能够找到正确的模块来使用图像部分,您可以这样使用模块: import winrt.windows.ui.notifications as notifications

有没有办法在Windows10中使用python创建交互式toast通知? 目前我正在使用
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(通知)

另外,有三个地方可以放置图像:,和。

最好提及一些代码,而不仅仅是链接作者没有提供任何代码,那么我为什么要这样做呢