percentcomplete#

percentcomplete(step=None, maxsteps=None, stepsize=1, prefix=None)[source]#

Display progress as a percentage.

Examples:

maxiters = 500

# Will print on every 5th iteration
for i in range(maxiters):
    sc.percentcomplete(i, maxiters)

# Will print on every 50th iteration
for i in range(maxiters):
    sc.percentcomplete(i, maxiters, stepsize=10)

# Will print e.g. 'Completeness: 1%'
for i in range(maxiters):
    sc.percentcomplete(i, maxiters, prefix='Completeness: ')

See also sc.progressbar() for a progress bar.