线程的创建

线程创建方式与进程创建方式基本一致

from threading import Thread

import time

def test():

  print("hello world")

  time.sleep(1)

for x in range(5):  

  t = Thread(target = test)

  t.start()

 

 

posted @ 2017-10-23 20:52  我为Xin媛学Python  阅读(87)  评论(0)    收藏  举报