def exit_gracefully(code=0):
 global RUN_CONFIG
 if os.path.exists(RUN_CONFIG.temp):
  for f in os.listdir(RUN_CONFIG.temp):
   os.remove((RUN_CONFIG.temp + f))
  os.rmdir(RUN_CONFIG.temp)
 disable_monitor_mode()
 mac_change_back()
 print (((GR + ' [+]') + W) + ' quitting')
 print ''
 exit(code)

def exit_gracefully ( code = 0 ) : global RUN_CONFIG if os . path . exists ( RUN_CONFIG . temp ) : for f in os . listdir ( RUN_CONFIG . temp ) : os . remove ( ( RUN_CONFIG . temp + f ) ) os . rmdir ( RUN_CONFIG . temp ) disable_monitor_mode ( ) mac_change_back ( ) print ( ( ( GR + ' [+]' ) + W ) + ' quitting' ) print '' exit ( code )
we may exit the program at any time .