My code snippet look like this:
from time import sleep
for i in xrange(10):
status = "hello%s" % str(i)
status = status + chr(8)*(len(status)+1)
sleep(1)
print status
which behaves differently with
print status
and
print status,
Now when i use a comma after print status
then print
outputs to stdout only once. i.e. after the loop iterates for the last time, where as when i don't put that comma after print status
then print
outputs to stdout each time it is called (as i expect it to).
I dont understand what is happening underneath. Can anyone explain. thanks :)