今天打算重新学一下pyqt5 ,遇到了一个错误;后来发现原来需要name哪里是两个斜杠
- if _name_ == "__main__":
- NameError: name '_name_' is not defined
- import sys
- from PyQt5.QtWidgets import QApplication,QLabel
-
- if __name__ == "__main__":
- app = QApplication(sys.argv)
- label = QLabel("Hello Word")
- label.show(app.exec_())