usr bin python coding UTF-8 import sys from PyQt4 QtGui import QApplic

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import sys
from PyQt4.QtGui import QApplication, QDialog, QSystemTrayIcon, QIcon
class Form(QDialog):
def __init__(self,parent=None):
super(Form, self).__init__(parent)
self.tray_icon = QSystemTrayIcon()
self.tray_icon.setIcon(QIcon('icon.png'))
self.tray_icon.show()
self.tray_icon.showMessage('It\'s me', 'Hello world!')
app = QApplication(sys.argv)
form = Form()
form.show()
sys.exit(app.exec_())