Created
November 26, 2018 05:47
-
-
Save nad2000/e8f034ed83be2809726859d5656b97c2 to your computer and use it in GitHub Desktop.
queue and threading demo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from time import sleep | |
from queue import Queue | |
from threading import Thread | |
q = Queue(2) | |
Thread(target=lambda:(sleep(10), q.put(42))).start() | |
q.get() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment