import _thread
from queue import Queue

q = Queue(20)


def get():
    while True:
        msg = q.get()
        print("msg = {}".format(msg))


_thread.start_new_thread(get, ())

q.put("this is a msg")
