import sys
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
def window():
app = QApplication(sys.argv)
win = QWidget()
fbox = QFormLayout()
# First fbox
fbox.addRow(QLabel("Name"), QLineEdit())
# Second fbox
vbox = QVBoxLayout()
vbox.addWidget(QLineEdit())
vbox.addWidget(QLineEdit())
fbox.addRow(QLabel("Address"), vbox)
# Third fbox
hbox = QHBoxLayout()
hbox.addWidget(QRadioButton("Male"))
hbox.addWidget(QRadioButton("Female"))
hbox.addStretch()
fbox.addRow(QLabel("sex"), hbox)
# Last fbox
hbox = QHBoxLayout()
hbox.addWidget(QPushButton("Submit"))
hbox.addWidget(QPushButton("Cancel"))
fbox.addRow(hbox)
win.setLayout(fbox)
win.setWindowTitle("PyQt")
win.show()
sys.exit(app.exec_())
if __name__ == '__main__':
window()
https://www.tutorialspoint.com/pyqt5/pyqt5_qformlayout_class.htm
PyQt5
因不支援副檔名為xmls的檔案,故須透過 offiece 轉成xls,也不能直接從檔名改,否則一樣不支援 Ref. Localizable.strings2Excel
Jun 1, 2022Ref. Python内置库:configparser(INI格式配置文件解析)
Oct 25, 2021Ref. 【python的異常處理】異常的捕捉
Jul 22, 2021調整了範例,讓 timer t 可在任意位置取消 timer 的運作,指令 t.cancel() import threading # global t t = None def set_interval(func, sec): global t
Jul 21, 2021or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up