# coding=utf-8from PyQt4.QtGui import *from PyQt4.QtCore import *import localeclass MyQThread(QThread): def __init__(self, parent=None): super(MyQThread, self).__init__(parent) self.working = True self.num = 0 def __del__(self): self.working = False self.wait() def run(self): while self.working == True: file_str = 'File index {0}'.format(self.num) self.num += 1 self.emit(SIGNAL('output(QString)'), file_str) self.sleep(3) print 'jianpan'