3自动创建与启动的父线程

"""自动创建与启动的父线程"""


"""
任何进程都会自动创建并启动一个线程,这个线程是父/主线程。
父/主线程的默认名称是MainThread
"""
import time, threading

# 方法current_thread()用于获得当前线程实例对象
print('自动创建并启动了父线程%s' % threading.current_thread().getName())

time.sleep(20)


原文地址:https://www.cnblogs.com/sruzzg/p/12991797.html