Python可以做的事情真的太多了,常見的網站開發,軟體開發,爬蟲,資料分析,人工智能,機器學習,量化投資,自動化辦公,自動化運維,游戲開發,腳本制作,樹莓派等等等等~
今天咱們就來試試用Python做一個簡單的程式,只需要十幾行代碼即可,灰常簡單~

知識點
PyQt6
sys
代碼展示
#引入類 # 更多好玩的代碼 都放在這個群啦 279199867 from PyQt6.QtWidgets import ( QApplication, QDialog, QPushButton, QHBoxLayout, QMessageBox ) import sys if __name__ == "__main__": app = QApplication(sys.argv) window = QDialog() window.resize(400, 300) #彈出視窗 def show_msg(): QMessageBox.information(window, "資訊提示", "你點擊了我") hbox = QHBoxLayout() button = QPushButton("雷猴啊,靚仔") button.clicked.connect(show_msg) hbox.addWidget(button) window.setLayout(hbox) #展示視窗 window.show() sys.exit(app.exec())
效果展示

代碼都在上面了,直接復制即可~
推薦一套Python視頻:Python實戰專案100例
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/509304.html
標籤:其他
下一篇:Activiti 7 原始碼學習
