You dont need script() or task() functions at all. It was just an illustration of how to use it.
Put
Script
being your entire program, and task
being any function within your program that does something as the purpose of the program's existancePut
progress(0)
in the beginning of your script, and progress(100)
at the end of it. Then divide 100 by your programs' number of tasks and put progress(THAT_NUM)
after task 1, program(THAT_NUM*2)
after task 2, program(THAT_NUM*3)
after task 3, etc.Quote:In this case there are 5 tasks throughout the entire program progressing the bar 20% each time.progress(0,'running task 1') task() progress(20,'running task 2') task() progress(40,'running task 3') task() progress(60,'running task 4') task() progress(80,'running task 5') task() progress(100, ' complete ')
100/5=20
100/number of tasks = percentage to increase after each task
Recommended Tutorials: