#print files_found #try: # while(True): #pass # print n.name + " %s" %n.isAlive() # print m.name + " %s" %m.isAlive() #except (KeyboardInterrupt,SystemExit): # for thread in enumerate(): # if thread.isAlive(): # try: # thread.stop() # thread.join() # thread._Thread__stop() # except: # print(str(thread.getName()) + ' could not be terminated') #sys.exit and thread.exit are equivalent #sys.exit('\n!!!Interrupcion de teclado recibida, cerrando aplicacion.\n') time.sleep(5) if m.isAlive(): print "Ending " + m.getName() m._Thread__stop() elif n.isAlive(): print "Ending " + n.getName() n._Thread__stop() server = Server() server.run() print "Terminated"