Commit a13c13ad authored by Bstrdsmkr's avatar Bstrdsmkr
Browse files

Add simple threading example

parent 500294a4
import time
from threading import Thread
def do_thing_1(name):
while True:
print "\nHis name was {}\n".format(name)
time.sleep(60)
# For functions that take arguments
thing_one = Thread(target=do_thing_1, args=("Robert Paulson",))
# For functions without arguments, just:
# thing_one = Thread(target=do_thing_1)
thing_one.daemon = True
thing_one.start()
while True:
raw_input('Say something: ')
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment