Skip to content

Instantly share code, notes, and snippets.

@marten
Created September 4, 2012 12:23
Show Gist options
  • Save marten/3620720 to your computer and use it in GitHub Desktop.
Save marten/3620720 to your computer and use it in GitHub Desktop.
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