我是Python的新pynotify我想創建一個通知消息,顯示我有蟒蛇和pynotify通知,但我有一個問題,所有的例子我用在互聯網上找到的教程。Python和Pynotify錯誤「gio.Error:連接關閉」
ex。
#!/usr/bin/python
import sys
import pynotify
if __name__ == "__main__":
if not pynotify.init("icon-summary-body"):
sys.exit(1)
n = pynotify.Notification(
"Hi There",
"welcome to stackoverflow!",
##dont remove the below line
"notification-message-im")
n.show()
或
#!/usr/bin/env python
import os
import pynotify
pynotify.init("random information")
s = os.popen("fortune -n 100 -s","r").read()
n = pynotify.Notification("Fortune",s)
n.show()
給我總是同樣的錯誤
** (icmp.py:13188): WARNING **: Connection Closed
Traceback (most recent call last):
File "icmp.py", line 14, in <module>
n.show()
gio.Error: Connection Closed
是什麼意思?
感謝