Exemplo n.º 1
0
import time
import random
from ppl import pb

total = 120
tasks = ["Making paintball", "Finding dragons", "Taking out the trash"]

print('With iter_name')
for task in tasks:
    i = 0
    for i in pb(range(total), task=task):
        sleep_time = [.05, .04, .03, .02, .01][random.randint(0, 4)]
        time.sleep(sleep_time)  # emulating long-playing task

print('\nWithout iter_name')
for task in tasks:
    i = 0
    for i in pb(range(total), task=task, iter_name=None):
        sleep_time = [.05, .04, .03, .02, .01][random.randint(0, 4)]
        time.sleep(sleep_time)  # emulating long-playing task
Exemplo n.º 2
0
import time
import random
from ppl import pb

total = 120
tasks = [
    'Making paintball', 'Finding dragons', 'Taking out the trash',
    'Filling up water bottles for trip'
]
for task in tasks:
    i = 0
    for i in pb(range(total), task=task, mini=True):
        sleep_time = [.05, .04, .03, .02, .01][random.randint(0, 4)]
        time.sleep(sleep_time)  # emulating long-playing task
Exemplo n.º 3
0
import time
from ppl import pb


def square(nums):
    for i in nums:
        yield (i * i)


tasks = ["Mapping points", "Painting rainbow white"]
counts = [100, 400, 100, 50]
times = [.01, .01, .03, .05]

print("With iter_name")
for x in zip(tasks, counts, times):
    for i in pb(square(range(x[1])), task=x[0]):
        time.sleep(x[2])

print("\nWithout iter_name")
for x in zip(tasks, counts, times):
    for i in pb(square(range(x[1])), task=x[0], iter_name=None):
        time.sleep(x[2])
Exemplo n.º 4
0
import time
import random
from ppl import pb

total = 120
tasks = [
    'Make paintball', 'Find dragons', 'Code in python', 'Take out the trash',
    'Fill up water bottles for trip'
]
for task in tasks:
    i = 0
    for i in pb(range(total), task=task):
        sleep_time = [.05, .04, .03, .02, .01][random.randint(0, 4)]
        time.sleep(sleep_time)  # emulating long-playing task
Exemplo n.º 5
0
import time
from ppl import pb

for i in pb(range(100), bar_len=20):
    time.sleep(0.1)
Exemplo n.º 6
0
Arquivo: simple.py Projeto: meain/ppl
import time
from ppl import pb

for i in pb(range(100)):
    time.sleep(0.1)
Exemplo n.º 7
0
import time
from ppl import pb


def square(nums):
    for i in nums:
        yield (i * i)


tasks = ["Mapping points", "Painting rainbow white"]
counts = [100, 400, 100, 50]
times = [.01, .01, .03, .05]

print("With iter_name")
for x in zip(tasks, counts, times):
    for i in pb(square(range(x[1])), task=x[0], mini=True):
        time.sleep(x[2])

print("\nWithout iter_name")
for x in zip(tasks, counts, times):
    for i in pb(square(range(x[1])), task=x[0], mini=True, iter_name=None):
        time.sleep(x[2])
Exemplo n.º 8
0
Arquivo: mini.py Projeto: meain/ppl
from ppl import pb
import time

for i in pb(range(10), mini=True):
    time.sleep(1)

for i in pb(range(10)):
    time.sleep(1)