import sys
from PyQt4 import QtGui
class Icon(QtGui.QWidget):
def __init__(self,parent=None):
QtGui.QWidget.__init__(self,parent)
self.setGeometry(300,300,250,150)
self.setWindowTitle(‘Icon‘)
self.setWindowIcon(QtGui.QIcon(‘f:1.jpg‘))
app=QtGui.QApplication(sys.argv)
icon=Icon()
icon.show()
sys.exit(app.exec_())
时间: 2024-10-09 09:00:25