Ask Your Question

Create dynamically updatable progress bar

asked 2011-07-29 07:25:28 +0200

Eugene gravatar image


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):
        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):
        bar.value = (i+1)*10

progressBar= ProgressBar()
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2011-07-29 12:05:53 +0200

parzan gravatar image

Check out this discussion in stack-overflow.

edit flag offensive delete link more


Indeed; you can also google for some more sophisticated progress bars implemented in Python.

niles gravatar imageniles ( 2011-07-29 12:11:03 +0200 )edit

Text progress bar is nice solution.. yet something graphical, which can be used within notebook is still desired.

Eugene gravatar imageEugene ( 2011-07-29 13:25:07 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2011-07-29 07:25:28 +0200

Seen: 1,458 times

Last updated: Jul 29 '11