code: def custom_prompt(msg, delims="", completer=lambda: None):
      
      try:
          orig_delims = readline.get_completer_delims()
          orig_completer = readline.get_completer()
  
          readline.set_completer_delims(delims)
          readline.set_completer(completer)
  
          try:
              ret = input(msg)
          finally:
              readline.set_completer_delims(orig_delims)
              readline.set_completer(orig_completer)
  
          return ret
      except EOFError:
          raise UserQuit()
docs: Start up a prompt that with particular delims and completer