'threading.main_thread()'
returns the main thread object.
MyThread.py
import threading mainThread = threading.main_thread() print("Is main thread alive : ", mainThread.is_alive()) print("Is main thread daemon thread : ", mainThread.isDaemon())
$ python3 MyThread.py Is main thread alive : True Is main thread daemon thread : False
No comments:
Post a Comment