datetime
os
random
sys
PyQt5
支持功能:
添加信息
修改信息
刪除信息
查詢信息
文件存儲數據,每次運行都會加載顯示之前的信息
# 創建字體對象,用來對要顯示的文字進行設定
font = QtGui.QFont()
font.setFamily("黑體")
font.setPointSize(12)
# 姓名
label_name = QLabel(self)
label_name.setGeometry(40, 30, 54, 16)
label_name.setText("姓名:")
label_name.setFont(font)
self.line_edit_name = QLineEdit(self)
self.line_edit_name.setGeometry(90, 30, 141, 20)
# 性別
label_gender = QLabel(self)
label_gender.setGeometry(270, 30, 54, 16)
label_gender.setFont(font)
label_gender.setText("性別:")
self.line_edit_gender = QComboBox(self)
self.line_edit_gender.setGeometry(340, 30, 201, 20)
self.line_edit_gender.addItems(['男', '女'])
# 身份證
label_id = QLabel(self)
label_id.setGeometry(580, 30, 54, 16)
label_id.setFont(font)
label_id.setText("身份證:")
self.line_edit_id = QLineEdit(self)
self.line_edit_id.setGeometry(660, 30, 221, 20)
# 地址
label_addr = QLabel(self)
label_addr.setGeometry(40, 110, 54, 16)
label_addr.setFont(font)
label_addr.setText("地址:")
self.line_edit_addr = QLineEdit(self)
self.line_edit_addr.setGeometry(92, 110, 141, 20)
# 電話
label_phone = QLabel(self)
label_phone.setGeometry(270, 70, 54, 16)
label_phone.setFont(font)
label_phone.setText("電話:")
self.line_edit_phone = QLineEdit(self)
self.line_edit_phone.setGeometry(340, 70, 201, 20)
更多資料、源碼、課件&報錯解答可以掃底部獲取