Use instead of print, to clear the status information before printing
191650
def console_output(msg, logging_msg=None):
    """"""
    assert isinstance(msg, bytes)
    assert isinstance(logging_msg, bytes) or logging_msg is None

    from polysh import remote_dispatcher

    remote_dispatcher.log(logging_msg or msg)
    if remote_dispatcher.options.interactive:
        from polysh.stdin import the_stdin_thread
        the_stdin_thread.no_raw_input()
        global last_status_length
        if last_status_length:
            safe_write('\r{}\r'.format(
                last_status_length * ' ').encode())
            last_status_length = 0
    safe_write(msg)
568762
def print(self, indent=2):
        """"""
        status = {
            ResultCode.NOT_IMPLEMENTED: '{}not implemented{}'.format(
                Fore.YELLOW, Style.RESET_ALL),
            ResultCode.IGNORED: '{}failed (ignored){}'.format(
                Fore.YELLOW, Style.RESET_ALL),
            ResultCode.FAILED: '{}failed{}'.format(
                Fore.RED, Style.RESET_ALL),
            ResultCode.PASSED: '{}passed{}'.format(
                Fore.GREEN, Style.RESET_ALL),
        }.get(self.code)
        print('{bold}{group}{provider}{checker}: {none}{status}{none}'.format(
            bold=Style.BRIGHT,
            group=(self.group.name + ' – ') if self.group.name else '',
            provider=(self.provider.name + ' – ') if self.provider else '',
            checker=self.checker.name,
            none=Style.RESET_ALL,
            status=status))
        if self.messages:
            for message in self.messages.split('\n'):
                print(pretty_description(message, indent=indent))
            if self.checker.hint:
                print(pretty_description(
                    'Hint: ' + self.checker.hint, indent=indent))
863318
def clean
      print 'Are you sure you want to clean this project directory? (Y|n): '
      confirm = $stdin.gets.chomp
      if confirm != 'Y' && confirm != 'n'
        puts 'Please enter Y or n'
      elsif confirm == 'Y'
        path = options[:directory] || Dir.pwd
        Builder.clean path
      end
      
    end
1356352
def OLD_printDebug(s, style=None):
    
    if style == "comment":
        s = Style.DIM + s + Style.RESET_ALL
    elif style == "important":
        s = Style.BRIGHT + s + Style.RESET_ALL
    elif style == "normal":
        s = Style.RESET_ALL + s + Style.RESET_ALL
    elif style == "red":
        s = Fore.RED + s + Style.RESET_ALL
    elif style == "green":
        s = Fore.GREEN + s + Style.RESET_ALL
    try:
        print(s, file=sys.stderr)
    except:
        pass
763310
def _print_if_needed(self):
        """"""
        if self._in_txn or self.print_frequency is None:
            return
        elif self.last_export is not None and \
             self.last_export + self.print_frequency > time.time():
            return

        self.export()
507326
def do_status(self):
        
        
        # Get the PID of the service
        pid    = self.pid.get()
        
        # Status color / attributes
        status_color  = 'green' if pid else 'red'
        status_dot    = self._colorize(UNICODE['dot'], status_color, encode=True)
        
        # Active text
        active_txt    = {
            'active':   '{} since {}'.format(self._colorize('active (running)', 'green'), self.pid.birthday()[1]),
            'inactive': 'inactive (dead)'
        }
        
        # Print the status message
        print(status_dot, end=' ')
        print('{}.service - LSB: {}'.format(self.name, self.desc))
        print('   Loaded: loaded (/etc/init.d/{})'.format(self.name))
        print('   Active: {}'.format(active_txt['active' if pid else 'inactive']))
        
        # Extra information if running
        if pid:
            ps = self.pid.ps()
            print('  Process: {}; [{}]'.format(pid, ps[0]))
            if ps[1]:
                for c in ps[1]:
                    print('    Child: {}'.format(c))
        print('')
1162441
def output(self, msg, indent, status=None):
        
        color = None
        if self.use_color:
            color = get_color_from_status(status)
        print_indent_msg(msg, indent, color)
1255661
def printer(self):
        """"""
        i = 0
        while i < self.n + 1:
            print "--------- State No --------" + repr(i)
            self.s[i].printer()
            i = i + 1
732729
def reset_status(self):
        """"""
        for row in range(self.table.rowCount()):
            status_item = self.table.item(row, 1)
            status_item.setText(self.tr(''))
350434
def _print_results(file, status):
        

        file_color = c.Fore.GREEN
        status_color = c.Fore.RED
        if status == 'Success':
            status_color = c.Fore.GREEN
        elif status == 'Skipped':
            status_color = c.Fore.YELLOW
        print(
            '{}{!s:<13}{}{!s:<35}{}{!s:<8}{}{}'.format(
                c.Fore.CYAN,
                'Downloading:',
                file_color,
                file,
                c.Fore.CYAN,
                'Status:',
                status_color,
                status,
            )
        )
1313587
def show_status(self):
        
        txt = 'Agent Status:\n'
        print(txt)
        txt += "start_x  = " + str(self.start_x) + "\n"
        txt += "start_y  = " + str(self.start_y) + "\n"
        txt += "target_x = " + str(self.target_x) + "\n"
        txt += "target_y = " + str(self.target_y) + "\n"
        txt += "current_x = " + str(self.current_x) + "\n"
        txt += "current_y = " + str(self.current_y) + "\n"
       
        
        print(self.grd)
        return txt
536277
public static function clearOutput(): void
  {
    // Return immediately if skipClearOutput is set.
    if (self::$skipClearOutput) return;

    $level = ob_get_level();

    // The following manual level counting is to deal with zlib.output_compression set to On.
    for ($i = $level; $i>0; --$i)
    {
      if (!@ob_end_clean())
      {
        ob_clean();
      }
    }

    if ($level>0)
    {
      // Restart output buffer in order to allow modification of headers.
      ob_start();
    }
  }
281374
def print_status(self):
        """"""
        s = []
        s.append('=== State Machines: ===\n')
        for stm_id in Driver._stms_by_id:
            stm = Driver._stms_by_id[stm_id]
            s.append('    - {} in state {}\n'.format(stm.id, stm.state))
        s.append('=== Events in Queue: ===\n')
        for event in self._event_queue.queue:
            if event is not None:
                s.append('    - {} for {} with args:{} kwargs:{}\n'.format(
                    event['id'], event['stm'].id,
                    event['args'], event['kwargs']))
        s.append('=== Active Timers: {} ===\n'.format(len(self._timer_queue)))
        for timer in self._timer_queue:
            s.append('    - {} for {} with timeout {}\n'.format(
                timer['id'], timer['stm'].id, timer['timeout']))
        s.append('=== ================ ===\n')
        return ''.join(s)
1235152
def status():
    ''''''
    with Session() as session:
        resp = session.Manager.status()
        print(tabulate([('Status', 'Active Sessions'),
                        (resp['status'], resp['active_sessions'])],
                       headers='firstrow'))
35633
def _maybe_print(something_to_print, end=None, min_=1, max_=99, verbose=0):
    """"""
    if min_ <= verbose <= max_:
        import sys
        print(something_to_print, end=end)
        sys.stdout.flush()
63307
def do_status(self, arg):
        '''  '''
        info = self.arm.get_info()
        max_len = len(max(info.keys(), key=len))

        print(self.style.theme('\nArm Status'))
        for key, value in info.items():
            print(self.style.help(key.ljust(max_len + 2), str(value)))
        print()
610488
def _clear_output(self):
        
        # If progress output was being written, clear it from the screen.
        if self.progress_output:
            sys.stderr.write("\r".ljust(self.last_line_len))
            sys.stderr.write("\r")
            sys.stderr.flush()