On 5/06/11 05:40:17, Sarcar, Shourya C (GE Healthcare) wrote:
A way to do this on DOS/Windows console would be:

import sys
for r in range(0,2**16):
        line = "Count : %d" % r
        sys.stdout.write(line)
        sys.stdout.flush()
        # do something that consumes time
        backup = "\b" * len(line) # The backspace character; this will
prevent characters from the prev "print" showing up   
        sys.stdout.write(backup)
        sys.stdout.flush()

You can achieve that effect on Posix systems by writing a "\r".

However, the OP wanted to print a report of perhaps six lines, so
the question is: how would you then move the cursor five lines up?

P.S: This is my first post to the list and I am new to python and I have
Outlook as my mail client. Can't get worse.  I am sure I am flouting some
response/quoting etiquette here. If someone could guide, I would be most
grateful.

One of the problems with Outlook is that it seduces you to put your
reply above the text you're replying to; the jargon phrase for this
is "top posting".  This practice is frowned upon in this forum.

We prefer responses below the original, so that a person who hasn't
read earlier posts in a thread can understand yours when reading it
from top to bottom.

If you're responding to several points made in the previous post,
you would put your response below the paragraph in which it is made,
and delete the paragraphs you're not responding to.

Kind regards,

-- HansM

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to