<br><br><div class="gmail_quote">On Mon, Apr 9, 2012 at 14:46, mqk <span dir="ltr"><<a href="mailto:kuhlen@gmail.com">kuhlen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi MinRK<br>
<br>
Thanks for your response. I did come across your working example, but I<br>
don't like it. :) The repeated clearing of the output results in a<br>
strobe-like appearance for me, and of course it also erases any previous<br>
output that is unrelated to the progress bar. Oh well.<br></blockquote><div><br></div><div>The strobe complaint is common, and actually fixed in an <a href="https://github.com/ipython/ipython/pull/1563">outstanding PR</a>. You can selectively clear stdout/stderr/pyout, but not subsets of each of those. That said, if you want the notebook to be a terminal emulator, you don't actually want the notebook. For instance, a more natural progress bar for the notebook would just be written in Javascript.</div>
<div><br></div><div>Here's one I just wrote based on a quick Googling of 'javascript progress bar' since receiving your email:</div><div><br></div><div><div>import uuid</div><div>from IPython.core.display import HTML, Javascript, display</div>
<div><br></div><div>divid = str(uuid.uuid4())</div><div><br></div><div>display(HTML(</div><div>"""</div><div><div style="border: 1px solid black; width:500px"></div><div> <div id="%s" style="background-color:blue; width:0%%">&nbsp;</div></div>
<div></div> </div><div>""" % divid)</div><div>)</div><div><br></div><div>for i in range(1,101):</div><div> time.sleep(0.1)</div><div> display(Javascript("$('div#%s').width('%i%%')" % (divid, i)))</div>
</div><div><br></div><div>It does require using my `clear_output` branch, pending as <a href="https://github.com/ipython/ipython/pull/1563">PR #1563</a>, to avoid some ugliness.</div><div><br></div><div>-MinRK</div><div>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
--<br>
View this message in context: <a href="http://python.6.n6.nabble.com/carriage-return-in-ipython-notebook-tp4717456p4717493.html" target="_blank">http://python.6.n6.nabble.com/carriage-return-in-ipython-notebook-tp4717456p4717493.html</a><br>
<div class="HOEnZb"><div class="h5">Sent from the IPython - User mailing list archive at Nabble.com.<br>
_______________________________________________<br>
IPython-User mailing list<br>
<a href="mailto:IPython-User@scipy.org">IPython-User@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/ipython-user" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-user</a><br>
</div></div></blockquote></div><br>