from threading import Thread
import time
class abc(Thread):
def run(self):
for i in range(5):
print 'abc'
time.sleep(1)
class xyz(Thread):
def run(self):
for i in range(5):
print 'xyz'
time.sleep(1)
a = abc()
b = xyz()
a.start()
time.sleep(0.2)
b.start()
a.join()
b.join()
print 'bye'
import time
class abc(Thread):
def run(self):
for i in range(5):
print 'abc'
time.sleep(1)
class xyz(Thread):
def run(self):
for i in range(5):
print 'xyz'
time.sleep(1)
a = abc()
b = xyz()
a.start()
time.sleep(0.2)
b.start()
a.join()
b.join()
print 'bye'
No comments:
Post a Comment