def setquit():
 if (os.sep == ':'):
  eof = 'Cmd-Q'
 elif (os.sep == '\\'):
  eof = 'Ctrl-Z plus Return'
 else:
  eof = 'Ctrl-D (i.e. EOF)'
 class Quitter(object, ):
  def __init__(self, name):
   self.name = name
  def __repr__(self):
   return ('Use %s() or %s to exit' % (self.name, eof))
  def __call__(self, code=None):
   try:
    sys.stdin.close()
   except:
    pass
   raise SystemExit(code)
 __builtin__.quit = Quitter('quit')
 __builtin__.exit = Quitter('exit')

def setquit ( ) : if ( os . sep == ':' ) : eof = 'Cmd-Q' elif ( os . sep == '\\' ) : eof = 'Ctrl-Z plus Return' else : eof = 'Ctrl-D (i.e. EOF)' class Quitter ( object , ) : def __init__ ( self , name ) : self . name = name def __repr__ ( self ) : return ( 'Use %s() or %s to exit' % ( self . name , eof ) ) def __call__ ( self , code = None ) : try : sys . stdin . close ( ) except : pass raise SystemExit ( code ) __builtin__ . quit = Quitter ( 'quit' ) __builtin__ . exit = Quitter ( 'exit' )
define new built-ins quit and exit .