def print_inplace(msg):
 term_width = get_terminal_size().columns
 spacing = (term_width - terminal_len(msg))
 if is_win32:
  spacing -= 1
 sys.stderr.write('\r{0}'.format(msg))
 sys.stderr.write((' ' * max(0, spacing)))
 sys.stderr.flush()

def print_inplace ( msg ) : term_width = get_terminal_size ( ) . columns spacing = ( term_width - terminal_len ( msg ) ) if is_win32 : spacing -= 1 sys . stderr . write ( '\r{0}' . format ( msg ) ) sys . stderr . write ( ( ' ' * max ( 0 , spacing ) ) ) sys . stderr . flush ( )
clears out the previous line and prints a new one .