from threading import Thread
import time
class CThread(Thread):
def __init__(self, s, n):
Thread.__init__(self)
self.s = s
self.n = n
def run(self):
print(self.s)
print(self.n)
for i in range(4):
print('CThread - run(self)')
time.sleep(2)
print('END - run(self)')
thrd = CThread('abc', 456)
thrd.start()
for i in range(4):
print('python')
time.sleep(1)
thrd.join()
print('END')
'''
run:
abc
456
CThread - run(self)
python
python
python
CThread - run(self)
python
CThread - run(self)
CThread - run(self)
END - run(self)
END
'''