如何在pynotify中设置本地图像?
如果我在 Ubuntu 10.04 中的 python
中运行以下命令:
>>> import pynotify
>>> p = pynotify.Notification ("Notice","","/home/george/Pictures/test.png")
>>> p.show()
true
该消息将按预期显示,但图像不会出现在 OSD 中。如何显示本地图片?
事实上,对于我所需要的,如果我能显示远程图像会更好。 (通过 HTTP)
我该怎么做?
If I run the following in python
in Ubuntu 10.04:
>>> import pynotify
>>> p = pynotify.Notification ("Notice","","/home/george/Pictures/test.png")
>>> p.show()
true
The message displays as expected, except the image does not appear in the OSD. How can I display a local image?
In fact, for what I need, it would be better if I could display a remote image. (via HTTP)
How can I do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
以下内容绝对适合我:
alt text http://www.imagebanana.com/img /qfmebkr5/screenshot_009.png
您确定图像在那里吗?有正确的权限吗?
The following definitely works for me:
alt text http://www.imagebanana.com/img/qfmebkr5/screenshot_009.png
Are you sure the image is there? With correct permissions?
这对我有用。也许您的后端不支持图标,或者您没有注意到。对于 KDE 4,它很小,但肯定位于左上角。另外,我认为 pynotify 对远程图像没有任何支持,因此请
根据需要使用:。
That works for me. Maybe your backend doesn't support icons, or you are not noticing. For KDE 4, it's small but definitely there in the upper-left. Also, I don't think there's any pynotify support for remote images, so use:
as needed.