Re: [Tutor] carriage return on windows

2005-02-01 Thread Alan Gauld
> 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. On Unix it i

Re: [Tutor] carriage return on windows

2005-02-01 Thread Victor Rex
Michael Janssen wrote: On Mon, 31 Jan 2005 18:01:59 -0600, Victor Rex <[EMAIL PROTECTED]> 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 h

Re: [Tutor] carriage return on windows

2005-02-01 Thread Michael Janssen
On Mon, 31 Jan 2005 18:01:59 -0600, Victor Rex <[EMAIL PROTECTED]> 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 > examp

Re: [Tutor] carriage return on windows

2005-01-31 Thread Kent Johnson
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. I

Re: [Tutor] carriage return on windows

2005-01-31 Thread Victor Rex
Orri Ganel wrote: Jacob S. wrote: Thanks Kent and Max! Wow, I didn't know it did that. I'm too dumb to figure it out on my own I guess... Oh well! I found a cool new thing to play with at least! Thanks, Jacob On Jan 30, 2005, at 02:40, Jacob S. wrote: I don't think that's what he wants. I th

Re: [Tutor] carriage return on windows

2005-01-30 Thread Alan Gauld
> print "Percent completed:" + str(percent) + "\r" > > Which should send me back to the beginning of the line and overwrite it > with a new line. But instead I get: > > Percent completed: 50 > Percent completed: 51 Print always adds a newline unless you put a comma at the end. Unfortunately that

Re: [Tutor] carriage return on windows

2005-01-29 Thread Orri Ganel
Jacob S. wrote: Thanks Kent and Max! Wow, I didn't know it did that. I'm too dumb to figure it out on my own I guess... Oh well! I found a cool new thing to play with at least! Thanks, Jacob On Jan 30, 2005, at 02:40, Jacob S. wrote: I don't think that's what he wants. I think he wants to *o

Re: [Tutor] carriage return on windows

2005-01-29 Thread Jacob S.
Thanks Kent and Max! Wow, I didn't know it did that. I'm too dumb to figure it out on my own I guess... Oh well! I found a cool new thing to play with at least! Thanks, Jacob On Jan 30, 2005, at 02:40, Jacob S. wrote: I don't think that's what he wants. I think he wants to *overwrite* what'

Re: [Tutor] carriage return on windows

2005-01-29 Thread Max Noel
On Jan 30, 2005, at 02:40, Jacob S. wrote: I don't think that's what he wants. I think he wants to *overwrite* what's in the shell with new output. For example. so that the whole line is overwritten. In my experience, this is not possible and if anyone can show me how to do it, I would be gratef

Re: [Tutor] carriage return on windows

2005-01-29 Thread Kent Johnson
It seems to work fine in Win2k command shell; try this: >>> import time >>> time.sleep(1) >>> for i in range(9): ... print 'i is', i, '\r', ... time.sleep(1) I get all the output on one line. Kent Jacob S. wrote: I don't think that's what he wants. I think he wants to *overwrite* what's i

Re: [Tutor] carriage return on windows

2005-01-29 Thread Jacob S.
I don't think that's what he wants. I think he wants to *overwrite* what's in the shell with new output. For example. Python 2.4 (#Stuff) ... Percent complete: 50 becomes... Python2.4(#Stuff) ... Percent complete: 51 so that the whole line is overwritten. In my experience, this is not possible

Re: [Tutor] carriage return on windows

2005-01-29 Thread Max Noel
On Jan 30, 2005, at 02:18, R. Alan Monroe wrote: print "Percent completed:" + str(percent) + "\r" Print forces a newline. Try sys.stdout.write instead. Alan You can also use the following syntax: >>> print "Percent completed:", str(percent), "\r", The trailing comma is NOT a typo, it is inten

Re: [Tutor] carriage return on windows

2005-01-29 Thread R. Alan Monroe
> print "Percent completed:" + str(percent) + "\r" Print forces a newline. Try sys.stdout.write instead. Alan ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] carriage return on windows

2005-01-29 Thread Bill Kranec
Hello, I'm trying to have a loop in a program print a message so I know it's status. Right now I'm using print "Percent completed:" + str(percent) + "\r" Which should send me back to the beginning of the line and overwrite it with a new line. But instead I get: Percent completed: 50 Percent c