Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Determine if thread has been started

How to determine if a python thread has been started? There is a method is_alive() but this is true before and while a thread is running.

like image 646
Razer Avatar asked Feb 22 '14 17:02

Razer


1 Answers

You can look at the ident field of the Thread instance. The Python 2.7 documentation for Threading describes ident as

The ‘thread identifier’ of this thread or None if the thread has not been started.

like image 96
gslavin Avatar answered Sep 20 '22 02:09

gslavin