def _flushWid2info(self):
self._sql = "select count(*) as total from test"
total = self._
mysql.findOne(self._sql)['total'] #找到总数
self._mysql.freeResult()
self._sql = "select * from test"
self._mysql.query(self._sql)
_tmp = self._mysql.findNext()
i = 0.0
while _tmp:
sys.stdout.write("%4d%% %d" % ((i / total) * 100, i) + "b" * (6 + len(str(int(i))))) #相除得出进度 b 就是退格
_tmp = self._mysql.findNext() #进度条
i += 1
_tmp = None