How to obtain a Thread id in Python? October 7, 2022 by Tarik threading.get_ident() works, or threading.current_thread().ident (or threading.currentThread().ident for Python < 2.6).