How to use the pyprind.prog_percent function in PyPrind

To help you get started, we’ve selected a few PyPrind examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github rasbt / pyprind / test / custom_stream.py View on Github external
for i in range(n):
    mbar.update()

mper = pyprind.ProgPercent(n, stream=sys.stdout)
for i in range(n):
    mper.update()

mbar2 = pyprind.ProgBar(n, stream='test')
for i in range(n):
    mbar2.update()

for i in pyprind.prog_bar(range(n), stream=sys.stdout):
    # do something
    pass

for i in pyprind.prog_percent(range(n), stream=sys.stdout):
    # do something
    pass

for i in pyprind.prog_bar(range(n), stream='test'):
    # do something
    pass
github rasbt / pyprind / test / percentage_indicator.py View on Github external
perc.update()

print('\n%s' % (80 * '='))
print('%s\n' % (80 * '='))
print('Testing stdout Stream\n')

perc = pyprind.ProgPercent(n, stream=sys.stdout)
for i in range(n):
    time.sleep(sleeptime)
    perc.update()

print('\n%s' % (80 * '='))
print('%s\n' % (80 * '='))
print('Testing Percentage Indicator Generator\n')

for i in pyprind.prog_percent(range(n), stream=sys.stdout):
    time.sleep(sleeptime)


print('\n%s' % (80 * '='))
print('%s\n' % (80 * '='))
print('Testing monitor function\n')

perc = pyprind.ProgPercent(n, monitor=True)
for i in range(n):
    time.sleep(sleeptime)
    perc.update()
print(perc)


print('\n%s' % (80 * '='))
print('%s\n' % (80 * '='))