code: def _freeze(self, final_text, err=False):
          
          if not final_text:
              final_text = ""
          target = self.stderr if err else self.stdout
          if target.closed:
              target = sys.stderr if err else sys.stdout
          text = to_text(final_text)
          last_frame = self._compose_out(text, mode="last")
          self._last_frame = decode_output(last_frame, target_stream=target)
  
          # Should be stopped here, otherwise prints after
          # self._freeze call will mess up the spinner
          self.stop()
          target.write(self._last_frame)
docs: Stop spinner, compose last frame and 'freeze' it.