import _thread
import time

# Define a function for the thread
def printT( threadName, delay):
   count = 0
   while count < delay:
      time.sleep(1)
      count += 1
      print ("%s: %s" % ( threadName, time.ctime(time.time()) ))

# Create two threads as follows
_thread.start_new_thread( printT, ("Thread-1", 2, ) )
_thread.start_new_thread( printT, ("Thread-2", 4, ) )


time.sleep(2)

