[IPython-dev] clear_output() of only last line?
mdroe at stsci.edu
Wed Apr 11 12:43:17 EDT 2012
I'm working on getting our animated progressbars in astropy to work in
the IPython notebook. I found the recipe of using "clear_output()" in
this bug report:
That gets things closer, but unlike "\r" at a standard terminal,
clear_output() clears the entire output chunk, not just the last line.
So if we have multiple progress bars, or progress bars interspersed with
logging messages, all but the last progress bar gets deleted.
from IPython.core.display import clear_output
for i in range(80):
print "\r" + ("=" * i)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IPython-dev