PyQt5显示一个空白的窗口
生活随笔
收集整理的這篇文章主要介紹了
PyQt5显示一个空白的窗口
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
效果如下圖:
?
1 """ 2 In this example, we create a simple 3 window in PyQt5. 4 """ 5 6 # provide the necessary imports. 7 # The basic widgets are located in PyQt5.QtWidgets module 8 import sys 9 from PyQt5.QtWidgets import QApplication, QWidget 10 11 if __name__ == '__main__': 12 13 app = QApplication(sys.argv) # create an application object 14 w = QWidget() # The QWidget widget is the base class of all user interface objects 15 w.resize(250, 150) # The resize() method resizes the widget 16 w.move(300, 300) # The move() method moves the widget to a position on the screen 17 w.setWindowTitle('Simple') # set the title of the window with setWindowTitle() 18 w.show() # The show() method displays the widget on the screen 19 sys.exit(app.exec_()) # The sys.exit() method ensures a clean exit?
?
轉(zhuǎn)載于:https://www.cnblogs.com/fuqia/p/8696764.html
總結(jié)
以上是生活随笔為你收集整理的PyQt5显示一个空白的窗口的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 浅谈线上德州扑克平台的公平性
- 下一篇: intellijidea课程 intel