command line reports

Darren Dale dd55 at cornell.edu
Thu Aug 11 15:43:23 EDT 2005


Peter Hansen wrote:

> Darren Dale wrote:
>> Is there a module somewhere that intelligently deals with reports to the
>> command line? I would like to report the progress of some pretty lengthy
>> simulations, and currently I have the new reports written on a new line
>> rather rather than overwriting the previous report.
> 
> You mean you want sys.stdout.write(report + '\r') instead of "print
> report" ?
> 
> It's not really clear what you want.  What's a "report" to you?
> 
> -Peter

I am printing something like 

trial 1 of 100
trial 2 of 100
...

so I get 100 lines by the time the code is finished. I would like to replace
the previous report with the current one, so I only use one line by the
time the code is finished.

I was also hoping that there was a set of tools out there for spinners,
meters, etc...



More information about the Python-list mailing list