Skip to content

Instantly share code, notes, and snippets.

@zkkmin
Created May 11, 2018 04:09
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 zkkmin/bb8dfcfdc7c324a55b141813739b204a to your computer and use it in GitHub Desktop.
Save zkkmin/bb8dfcfdc7c324a55b141813739b204a to your computer and use it in GitHub Desktop.
Python thread
from threading import Thread
class APIThread(Thread)
def __init__(self, data):
self.data = data
Thread.__init__(self)
def run(self)
# call external api
# process return value
# create new thread to call api
def make_thread(data)
APIThread(data).start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment