Victor Rex wrote:
I played around with this output issue and I love the way it works.
Now, how do you do this in *nix? I tried the same approach and I get a blank line for 5 seconds (or whatever number of cycles you have on your example) and the a final line with the last value of the iterable.

It sounds like the '\r' is erasing the line, not just moving the cursor. Try putting the '\r' at the beginning of the output rather than the end:


for i in range(10):
  print '\r', 'i is', i
  time.sleep(1)

Kent

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to