code: def _prompt(self, prompt=None):
          
          if prompt:
              # Print the prompt
              self.write(prompt)
              self.output.flush()
  
          # Read the line
          return to_str(self.input.readline())
docs: Reads a line written by the user
  
          :param prompt: An optional prompt message
          :return: The read line, after a conversion to str