Incremental Progress Report object/closure?

  • Thread starter Terrence Brannon
  • Start date
T

Terrence Brannon

'lo all, I'm looking for something that gives feedback to the screen
every X iterations, reporting

Time elapsed: 0:00:00 X,XXX,XXX records done. speed XXXX/second.
[Action Label]


Such a thingy is useful when one is cranking away at million record
flat files and one wants to provide feedback to the user lest he bash
away at the interrupt key in fear of his machine being locked up.

All the best mates,
-- meta
 
G

George Sakkis

Terrence said:
'lo all, I'm looking for something that gives feedback to the screen
every X iterations, reporting

Time elapsed: 0:00:00 X,XXX,XXX records done. speed XXXX/second.
[Action Label]


Such a thingy is useful when one is cranking away at million record
flat files and one wants to provide feedback to the user lest he bash
away at the interrupt key in fear of his machine being locked up.

All the best mates,
-- meta

Check out if any of the progress bar recipes in the Cookbook can be
tweaked to fit the bill:
http://aspn.activestate.com/ASPN/se...ar&x=0&y=0&section=PYTHONCKBK&type=Subsection

HTH,
George
 
G

Gabriel Genellina

'lo all, I'm looking for something that gives feedback to the screen
every X iterations, reporting

Time elapsed: 0:00:00 X,XXX,XXX records done. speed XXXX/second.
[Action Label]

What about a simple:

print "Time elapsed: blah blah blah\r" % whatever,

(notice the \r and the final , )



Gabriel Genellina
Softlab SRL





__________________________________________________
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya!
http://www.yahoo.com.ar/respuestas
 
F

Fredrik Lundh

Gabriel said:
What about a simple:

print "Time elapsed: blah blah blah\r" % whatever,

(notice the \r and the final , )

to avoid messing up the output when you're leaving the loop, or if
something goes wrong inside the loop, it's usually better to *start*
with a carriage return:

print "\rTime elapsed: blah blah blah" % whatever,

</F>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top