开发者

How to get pynotify to display line breaks and HTML?

开发者 https://www.devze.com 2023-01-07 00:01 出处:网络
How can I make pynotify display line breaks and HTML in the notifications? Here is what I got:开发者_如何学JAVA

How can I make pynotify display line breaks and HTML in the notifications?

Here is what I got:开发者_如何学JAVA

>>> import pynotify
>>> n = pynotify.Notification ("This is a test.\n\nAnd this too!",
                               "","notification-message-im")
>>> n.show()

Contrary to what is expected, there is no line-break between the two sentences. (At least not on Ubuntu 10.04)

Also, is there a way to include simple HTML in the notifications, like <b>, <br>, or <i>?


You can use '\n' in message body but not in summary.

>>> n = pynotify.Notification("summary", "body\n next line", "dialog-warning")
>>> n.show()
0

精彩评论

暂无评论...
验证码 换一张
取 消