添加线程

import threading

def thread_job():
    print("This is an added Thread,number is %s"% threading.current_thread())

def main():
#添加线程 added_thread =threading.Thread(target=thread_job) added_thread.start() #线程的数量 #print(threading.active_count()) #线程分别是什么 #print(threading.enumerate()) #现在运行的线程是哪个 #print(threading.current_thread()) if __name__=="__main__": main()

  

猜你喜欢

转载自www.cnblogs.com/jianglijian/p/10076096.html
今日推荐