<div class="gmail_quote">On Fri, Dec 10, 2010 at 2:38 PM, Corey Richardson <span dir="ltr">&lt;<a href="mailto:kb1pkl@aim.com">kb1pkl@aim.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div><div></div><div class="h5"><br>
<br>
On 12/10/2010 3:34 PM, Wayne Werner wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
If you just want a single line you can use chr(13) which is a carriage<br>
return. If you want a more complex program you&#39;ll need a curses type<br>
library<br>
hth, wayne<br>
<br>
On 12/10/10, Modulok&lt;<a href="mailto:modulok@gmail.com" target="_blank">modulok@gmail.com</a>&gt;  wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
List,<br>
<br>
Forgive me if I don&#39;t describe this well, I&#39;m new to it:<br>
<br>
Assume I&#39;m working in a command shell on a terminal. Something like<br>
tcsh on xterm, for example. I have a program which does *something*.<br>
Let&#39;s say it counts down from 10. How do I print a value, and then<br>
erase that value, replacing it with another value? Say I had something<br>
like &#39;10&#39; that appears, then wait a second, then the 10 is replaced by<br>
&#39;9&#39;... &#39;8&#39;.. and so forth. The point is, I don&#39;t want to print to a<br>
new line, nor do I want the new number to appear next to the previous<br>
number... I just want to change it in place. (If that makes any<br>
sense?) Think of console based progress counters in programs like<br>
fetch or wget, or lame.<br>
<br>
How do you do this in Python?<br>
-Modulok-<br>
_______________________________________________<br>
Tutor maillist  -  <a href="mailto:Tutor@python.org" target="_blank">Tutor@python.org</a><br>
To unsubscribe or change subscription options:<br>
<a href="http://mail.python.org/mailman/listinfo/tutor" target="_blank">http://mail.python.org/mailman/listinfo/tutor</a><br>
<br>
</blockquote></blockquote>
<br></div></div>
Try that in the interactive interpreter, it doesn&#39;t work.<br>
&gt;&gt;&gt; print &quot;a&quot; + chr(13)<br>
a<br>
(Python 2.6.6)<br></blockquote><div><br></div><div>Actually, it does:</div><div> &gt;&gt;&gt; print &#39;a&#39; + chr(13) + &#39;b&#39;</div><div>b</div><div><br></div><div>The cursor moves back, you just didn&#39;t bother to overwrite the &#39;a&#39;.</div>

<div><br></div><div>HTH,</div><div>Wayne</div></div><br>