Skip to content

Instantly share code, notes, and snippets.

@timtan
Last active December 14, 2015 20:09
Show Gist options
  • Select an option

  • Save timtan/5142320 to your computer and use it in GitHub Desktop.

Select an option

Save timtan/5142320 to your computer and use it in GitHub Desktop.
from __future__ import print_function
import threading
import time
ending = False
def response():
while not ending:
print('.')
time.sleep(1)
def fib(num):
time.sleep(1)
if num < 2:
return num
return fib(num-1) + fib(num-2)
thread = threading.Thread(target=response, name='')
thread.start()
print(fib(3))
ending = True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment