第一个图形界面程序 -- 简单示例

程序示例:

from PySide6.QtWidgets import QApplication, QMainWindow, QPushButton, QPlainTextEditapp = QApplication([])window = QMainWindow()
window.setWindowTitle("第一个窗口")
window.resize(500, 400)
window.move(600, 120)textEdit = QPlainTextEdit(window)
textEdit.setPlaceholderText("请输入")
textEdit.move(10, 20)
textEdit.resize(300, 350)button = QPushButton("统计", window)
button.move(380, 80)window.show()app.exec()

效果:

Code_J2zGwyRWh1