import sys
from PyQt5.QtWidgets import QApplication, QWidget
from PyQt5.QtGui import QIcon
##
logo_location = 'C:\\Users\\gbytt\\Dropbox\\[A] 공유폴더\\[E] VScode\\PyQt\\logo.png'
##
class MyApp(QWidget):
def __init__(self):
super().__init__()
self.initUI()
def initUI(self):
self.setWindowTitle('Icon')
self.setWindowIcon(QIcon(logo_location))
self.setGeometry(300, 300, 300, 200)
self.show()
if __name__ == '__main__':
app = QApplication(sys.argv)
ex = MyApp()
sys.exit(app.exec_())
Error appears as below
No name 'QApplication' in module 'PyQt5.QtWidgets'
No name 'QWidget' in module 'PyQt5.QtWidgets'
No name 'QIcon' in module 'PyQt5.QtGui'
But in IDLE it runs neatly without any errors.
Also, if you create a .pylintrc file and wirte 'extension-pkg-whitelist=pyQt5' and insert it, an error appears as shown below.
No name 'QApplication' in module 'PyQt5.QtWidgets'
No name 'QWidget' in module 'PyQt5.QtWidgets'
No name 'QIcon' in module 'PyQt5.QtGui'
Bad indentation. Found 2 spaces, expected 4
Bad indentation. Found 6 spaces, expected 8
Bad indentation. Found 6 spaces, expected 8
Bad indentation. Found 2 spaces, expected 4
Bad indentation. Found 6 spaces, expected 8
Bad indentation. Found 6 spaces, expected 8
Bad indentation. Found 6 spaces, expected 8
Bad indentation. Found 6 spaces, expected 8
Bad indentation. Found 2 spaces, expected 4
Bad indentation. Found 2 spaces, expected 4
Bad indentation. Found 2 spaces, expected 4
Module name "Framework" doesn't conform to snake_case nameing style
Missing module docstring
Constant name "logo_localtion" doesn't confrom to UPPER_CASE nameing style
Missing class docstring
Method name "initUI" doesn't confrom to snake_case naming style
Missing function or method docstring
Final newline missing