Python / UI and Layouts / Basic Window
Window
-
Step 1:
import sys from PyQt5 import QtWidgets def basicWindow(): app = QtWidgets.QApplication(sys.argv) windowExample = QtWidgets.QWidget() windowExample.setWindowTitle('Basic Window Example') windowExample.show() sys.exit(app.exec_()) basicWindow() PyQt5 Change Window Size
import sys from PyQt5 import QtWidgets def basicWindow(): app = QtWidgets.QApplication(sys.argv) windowExample = QtWidgets.QWidget() windowExample.setGeometry(0, 0, 400, 400) windowExample.setWindowTitle('Basic Window Example') windowExample.show() sys.exit(app.exec_()) basicWindow() PyQt5 Add Window Icon
import sys from PyQt5 import QtWidgets, QtGui def basicWindow(): app = QtWidgets.QApplication(sys.argv) windowExample = QtWidgets.QWidget() windowExample.setWindowTitle('Basic Window Example') windowExample.setWindowIcon(QtGui.QIcon("python.jpg")) windowExample.show() sys.exit(app.exec_()) basicWindow()