Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. import sys
  2. from PyQt4 import QtGui, QtCore
  3.  
  4. class FooThread(QtCore.QThread):
  5.  
  6. def __init__(self, foo):
  7. super(FooThread, self).__init__()
  8. self.foo = foo
  9.  
  10. def run(self):
  11. print self.foo
  12.  
  13. def main():
  14.  
  15. app = QtGui.QApplication(sys.argv)
  16. foo_thread = FooThread('foo')
  17. foo_thread.start()
  18. foo_thread.finished.connect(QtGui.qApp.exit)
  19. sys.exit(app.exec_())
  20.  
  21.  
  22. if __name__ == '__main__':
  23. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement