Progress Bars in python

Hari Sekhon sekhon.hari at googlemail.com
Wed Jul 12 10:44:17 EDT 2006


On 12/07/06, Fredrik Lundh <fredrik at pythonware.com> wrote:
>
> > If the output of the script is sent to a logfile, this tends to puke all
> > over the logfile... creating one additional entry per iteration, but
> it's a
> > good start and I'll look at that link which looks very promising.
>
> there's no way to do this without sending more stuff to stdout than you
> see; however, it's easy to *disable* the spinner if you're redirecting the
> output.  hint:
>
> $ python -c "import sys; print sys.stdout.isatty()"
> True
> $ python -c "import sys; print sys.stdout.isatty()" >out
> $ more out
> False
>
> </F>
>


Thanks, that will do nicely. It will be sufficient to do this testing using
isatty() and have the progress bar or spinner.

-h
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20060712/83a7aee0/attachment.html>


More information about the Python-list mailing list