表格条目超过10000就无法显示[s:6]

weixin_38066087 2019-09-19 05:54:23
我用python写了个显示表格的程序,用qt做界面。但如果条目超过10000,就只能显示前4位数字,不知哪位高手能指点一下?相关程序如下所示:   self.table1 = QTable(self,"table1")     self.table1.setGeometry(QRect(20,60,335,90))     mydb=MySQLdb.Connect(host="localhost", db="test",user="root",passwd="root")     mycursor=mydb.cursor()     stmt="select max(index) from aaa"     mycursor.execute(stmt)     result = mycursor.fetchall()     for record in result:         numEx=record[0]         self.table1.setNumRows(numEx)     self.table1.setNumCols(3)     self.languageChange()     for j in range(3):         stmt="select var"+str(j)+" from aaa where index<="+str(numEx)         #print stmt         mycursor.execute(stmt)         result = mycursor.fetchall()         i=0         for record in result:           x=record[0]           self.table1.setText(i, j, unicode(str(x),'MBCS'))           i +=1
...全文
20 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

434

社区成员

发帖
与我相关
我的任务
社区描述
其他技术讨论专区
其他 技术论坛(原bbs)
社区管理员
  • 其他技术讨论专区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧