mirror of
https://gitee.com/quecpython/helios-service.git
synced 2025-05-19 06:08:22 +08:00
16 lines
203 B
Python
16 lines
203 B
Python
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")
|