Created
December 2, 2023 17:42
-
-
Save theacodes/af95bd7b14b8421e031c8ca92d0effca to your computer and use it in GitHub Desktop.
Thread emoji
This file contains 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
import threading | |
ANIMALS = list( | |
"๐ถ๐ฑ๐ญ๐น๐ฐ๐ฆ๐ป๐ผ๐จ๐ฏ๐ฆ๐ฎ๐ท๐ฝ๐ธ๐ต๐๐ง๐ฆ๐ค๐ชฟ๐ฆ๐ฆ๐ฆ๐ฆ๐บ๐๐ด๐ฆ๐ซ๐๐ชฑ๐๐ฆ๐๐๐๐ชฐ๐ชฒ๐ชณ๐ฆ๐ฆ๐ท๏ธ๐ธ๏ธ๐ฆ๐ข๐๐ฆ๐ฆ๐ฆ๐๐ฆ๐ชผ๐ฆ๐ฆ๐ฆ๐ก๐ ๐๐ฌ๐ณ๐๐ฆ๐ฆญ๐๐ ๐๐ฆ๐ฆ๐ฆง๐ฆฃ๐๐ฆ๐ฆ๐ช๐ซ๐ฆ๐ฆ๐ฆฌ๐๐๐๐ซ๐๐๐๐๐ฆ๐๐ฆ๐๐ฉ๐๐๐ฆ๐ฆค๐ฆ๐ฆ๐ฆข๐ฆฉ๐๏ธ๐๐ฆ๐ฆจ๐ฆก๐ฆซ๐ฆฆ๐ฆฅ๐๐๐ฟ๏ธ๐ฆ๐๐ฒ" | |
) | |
ANIMALS_LEFT = [] | |
THREAD_EMOJI = {} | |
def thread_emoji(): | |
if threading.current_thread() is threading.main_thread(): | |
return "โญ๏ธ" | |
id = threading.get_native_id() | |
if id not in THREAD_EMOJI: | |
if not ANIMALS_LEFT: | |
ANIMALS_LEFT[:] = reversed(ANIMALS) | |
THREAD_EMOJI[id] = ANIMALS_LEFT.pop() | |
return THREAD_EMOJI[id] |
peyton2465
commented
Dec 3, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment