from twisted.internet import reactorimport timedef printTime(): print "Current time is",time.strftime("%H:%M:%S")def stopReactor(): print "Stopping reactor" print "Current time is",time.strftime("%H:%M:%S") reactor.stop()reactor.callLater(1, printTime)reactor.callLater(2, printTime)reactor.callLater(3, printTime)reactor.callLater(4, printTime)reactor.callLater(10, stopReactor)print "Running the reactor..."reactor.run()print 'Reactor stopped'