检索表时处理空值

时间:2019-02-28 12:47:28

标签: html jsp getter

am尝试使用JSP从Oracle DB检索数据到HTML表

import sys
from PyQt5 import QtWidgets, QtCore, QtGui

class MyForm(QtWidgets.QWidget):
    def __init__(self, parent = None):
        super(MyForm, self).__init__(parent)
        self.lcdNumber = QtWidgets.QLCDNumber(self)
        timer = QtCore.QTimer(self)
        timer.timeout.connect(self.showlcd)
        timer.start(1000)

        lbl = QtWidgets.QLabel("Clock", self)
        lbl.setAlignment(QtCore.Qt.AlignCenter)
        myFont = QtGui.QFont()
        myFont.setBold(True)
        lbl.setFont(myFont)

        vLayout = QtWidgets.QVBoxLayout(self)
        vLayout.addWidget(lbl)
        vLayout.addWidget(self.lcdNumber)
        self.setLayout(vLayout)

        self.showlcd()

    def showlcd(self):
        time = QtCore.QTime.currentTime()
        text = time.toString('hh:mm')
        self.lcdNumber.display(text)

if __name__ == "__main__":
    app = QtWidgets.QApplication(sys.argv)
    myapp = MyForm()
    myapp.show()
    sys.exit(app.exec_())

问题是当我得到一个空值l.getDocName()时,它破坏了我的其余代码,我该如何处理这个问题或将空值替换为空格或0

预先感谢

0 个答案:

没有答案