self.setWindowIcon(QtGui.QIcon('test_icon.png'))
self.show()

def main(args):
    app = QtGui.QApplication([])
ww = MyWin()
sys.exit(app.exec_())
if __name__ == '__main__':
    main(sys.argv[1:])
PyQt4 set windows taskbar icon