AK wrote:
import time, sys
print "ONE",
sys.stdout.flush()
time.sleep(0.5)
print "\rTWO",
sys.stdout.flush()
time.sleep(0.5)
Running the command above prints out
ONE
TWO
but running
for i in range(10):
print "ONE",
time.sleep(0.2)
prints out
ONE ONE ONE ONE ONE ONE ONE ONE ONE ONE
"Joel Ross"
To:
Sent: Sunday, May 24, 2009 4:32 AM
Subject: Re: Problems with sys.stout.flush()
> Mel wrote:
> > Joel Ross wrote:
> >> Rhodri James wrote:
> > [ ... ]
> >>> Except that you still have the interesting issue that your environment
&
Joel Ross wrote:
Rhodri James wrote:
On Sat, 23 May 2009 18:19:11 +0100, Joel Ross wrote:
Now I can move onto next one.
Except that you still have the interesting issue that your environment
isn't responding to '\r' correctly, which worries me rather. Or did
you never test that?
Yeah I ga
Mel wrote:
Joel Ross wrote:
Rhodri James wrote:
[ ... ]
Except that you still have the interesting issue that your environment
isn't responding to '\r' correctly, which worries me rather. Or did
you never test that?
Yeah I gave the "\r" a go and it kept printing out on a new line I will
lo
Joel Ross wrote:
> Rhodri James wrote:
[ ... ]
>> Except that you still have the interesting issue that your environment
>> isn't responding to '\r' correctly, which worries me rather. Or did
>> you never test that?
> Yeah I gave the "\r" a go and it kept printing out on a new line I will
> look
Dennis Lee Bieber wrote:
flush() is working perfectly fine -- it says transmit any data still
held within internal buffers. It is NOT a "clear screen", "clear line"
terminal command.
I was mistaken about the sys.stout.flush(). I understand it a little
more now thanks
--
http://mail.py
Rhodri James wrote:
On Sat, 23 May 2009 18:19:11 +0100, Joel Ross wrote:
Now I can move onto next one.
Except that you still have the interesting issue that your environment
isn't responding to '\r' correctly, which worries me rather. Or did
you never test that?
Yeah I gave the "\r" a go a
On Sat, 23 May 2009 18:19:11 +0100, Joel Ross wrote:
Now I can move onto next one.
Except that you still have the interesting issue that your environment
isn't responding to '\r' correctly, which worries me rather. Or did
you never test that?
--
Rhodri James *-* Wildebeeste Herder to the Ma
On May 23, 8:20 am, Dave Angel wrote:
> Incidentally, Carl's other suggestion, that you use a new variable
> instead of overwriting 'char', is a red herring.
Yeah, I dropped the ball on this one, I misread his code as being in a
loop instead of being called repeatedly. And after criticizing him
Thanks for all the help guys. I got it to work correctly with this
class progress:
def __init__(self):
self.already = 0
def progressbar(self, number, total, char):
percentage = int(100 - round(number*100.0/total))
if percentage > 0:
xchar = char * (perc
On Sun, 24 May 2009 00:44:21 +1000, Joel Ross wrote:
> Still having the same problem if I pass it 1000 lines it will printout
> 1000 asterisks when I say lines I mean the argument for the
> progress() function. I only want to printout 100 asterisks no matter how
> many lines I pass to the progres
Joel Ross wrote:
Carl
Banks wrote:
On May 23, 2:20 am, Joel Ross wrote:
Carl Banks wrote:
On May 22, 10:33 pm, Joel Ross wrote:
Hi all,
I'm using python 2.5 and trying to flush the sys.stout buffer with
sys.stout.flush(), but doesn't seem to work. Each time a line is
printed
it appends
Joel Ross wrote:
> class progress:
>
> def progressbar(self, number, total, char):
>
> percentage = float(number*100)/total
> percentage = int(round(percentage))
> percentage = int(100 - percentage)
> self.f=sys.stdout
> if percentage > 0:
>
Carl Banks wrote:
On May 23, 3:49 am, Joel Ross wrote:
def progressbar(self, number, total, char):
percentage = float(number*100)/total
percentage = int(round(percentage))
percentage = int(100 - percentage)
self.f=sys.stdout
if percentage > 0:
On May 23, 3:49 am, Joel Ross wrote:
> def progressbar(self, number, total, char):
>
> percentage = float(number*100)/total
> percentage = int(round(percentage))
> percentage = int(100 - percentage)
> self.f=sys.stdout
> if percentage > 0:
>
Carl Banks wrote:
On May 23, 2:20 am, Joel Ross wrote:
Carl Banks wrote:
On May 22, 10:33 pm, Joel Ross wrote:
Hi all,
I'm using python 2.5 and trying to flush the sys.stout buffer with
sys.stout.flush(), but doesn't seem to work. Each time a line is printed
it appends the one before it I
Hi all,
Is anyone aware of a 3-d plotting tool for simple mathematical functions. It
seems that all the tools available have their problems with new versions.
None of matplotlib, nor PyX, nor mat3d, seems to work for 3d anymore.
Any suggestions???
Thanks
--
http://mail.python.org/mailman/listi
On May 23, 2:20 am, Joel Ross wrote:
> Carl Banks wrote:
> > On May 22, 10:33 pm, Joel Ross wrote:
> >> Hi all,
>
> >> I'm using python 2.5 and trying to flush the sys.stout buffer with
> >> sys.stout.flush(), but doesn't seem to work. Each time a line is printed
> >> it appends the one before
Carl Banks wrote:
On May 22, 10:33 pm, Joel Ross wrote:
Hi all,
I'm using python 2.5 and trying to flush the sys.stout buffer with
sys.stout.flush(), but doesn't seem to work. Each time a line is printed
it appends the one before it I need to clear the output and write a
new output without
On May 22, 10:33 pm, Joel Ross wrote:
> Hi all,
>
> I'm using python 2.5 and trying to flush the sys.stout buffer with
> sys.stout.flush(), but doesn't seem to work. Each time a line is printed
> it appends the one before it I need to clear the output and write a
> new output without appending
Hi all,
I'm using python 2.5 and trying to flush the sys.stout buffer with
sys.stout.flush(), but doesn't seem to work. Each time a line is printed
it appends the one before it I need to clear the output and write a
new output without appending the previous one. I have tried the -u
(unbuffe
21 matches
Mail list logo