ASKSAGE: Sage Q&A Forum - Latest question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 29 Jul 2011 00:25:28 -0500Create dynamically updatable progress barhttp://ask.sagemath.org/question/8245/create-dynamically-updatable-progress-bar/Hi!
Sometimes calculations takes a long time, and it'll be very useful to know the progress. A simple example:
from time import sleep
def slow_calculations():
for i in range(10):
sleep(0.5)
print 'Complete',(i+1)*10,'%'
print 'Done'
Such indication of process was my first solution. Is is possible somehow to draw a progress bar and update it's value during the calculations? Something like that:
def slow_calculations(bar):
for i in range(10):
sleep(0.5)
bar.value = (i+1)*10
progressBar= ProgressBar()
progressBar.show()
slow_calculations(progressBar)EugeneFri, 29 Jul 2011 00:25:28 -0500http://ask.sagemath.org/question/8245/