Created
September 4, 2012 12:23
-
-
Save marten/3620720 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import threading | |
import time | |
class ReadoutSession: | |
def run(self): | |
# doe trage dingen, zoals | |
print "HOI" | |
time.sleep(5) | |
print "DOEI" | |
# in je GUI | |
def onStartClick(): | |
session = ReadoutSession() | |
thread = threading.Thread(target = session.run) | |
thread.start() | |
return thread | |
print "BEGIN" | |
thread = onStartClick() | |
print "EIND" | |
# dit staat hier zodat het programma niet eindigt | |
# voordat de thread klaar is | |
thread.join() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment