def __restart_line(): """ Writes return carriage to stdout and flushes. This allows writing to the same line. :return: None """ stdout.write('\r') stdout.flush()