python

import time
from threading import Thread

class text:
	def __init__(self, threads):
		for i in range(threads):
			t = Thread(target = self.threadget(i))
			t.setDaemon(True)
			t.start()

	def threadget(self,num):
		if num == 3:
			time.sleep(1)
		print num
		
text(20)
	
	

你可能感兴趣的:(python)