Terminal application with non-standard print

Rémi babedoudi at yahoo.fr
Sun Jan 24 14:39:53 EST 2010


Thank you for your answer, but that does not work : the second line is 
printed after the first one.

-- 
Rémi


Grant Edwards wrote:
> On 2010-01-24, R?mi <babedoudi at yahoo.fr> wrote:
> 
>> I would like to do a Python application that prints data to stdout, but
>> not the common way. I do not want the lines to be printed after each
>> other, but the old lines to be replaced with the new ones, like wget
>> does it for example (when downloading a file you can see the percentage
>> increasing on a same line).
> 
> sys.stdout.write("Here's the first line")
> time.sleep(1)
> sys.stdout.write("\rAnd this line replaces it.")
> 



More information about the Python-list mailing list