Skip to content

Instantly share code, notes, and snippets.

@brydavis
Created August 13, 2019 22:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brydavis/9fa37489a3412296a128b74e820c183f to your computer and use it in GitHub Desktop.
Save brydavis/9fa37489a3412296a128b74e820c183f to your computer and use it in GitHub Desktop.
import sys
import threading
import time
def func():
for i in range(5):
print("hello from thread %s" % threading.current_thread().name)
time.sleep(1)
threads = []
for i in range(3):
thread = threading.Thread(target=func, args=())
thread.start()
threads.append(thread)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment