vs code
shift + ctrl + p
import sys
from PyQt5.QtWidgets import QApplication, QWidget
from PyQt5.QtGui import QIcon
class MyApp(QWidget):
def init(self):
super().init()
self.initUI()
def initUI(self):
self.setWindowTitle('Icon')
self.setWindowIcon(QIcon('web.png'))
self.setGeometry(300, 300, 300, 200)
self.show()
if name == 'main':
app = QApplication(sys.argv)
ex = MyApp()
sys.exit(app.exec_())
터미널
python .\ex3-2_아이콘추가.py 입력