File: basic.py

package info (click to toggle)
enlighten 1.11.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,480 kB
  • sloc: python: 3,419; makefile: 20
file content (29 lines) | stat: -rw-r--r-- 620 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Copyright 2017 - 2020 Avram Lubkin, All Rights Reserved

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

"""
Basic progress bar example
"""

import time

import enlighten


def process_files():
    """
    Process files with a single progress bar
    """

    with enlighten.Counter(total=100, desc='Simple', unit='ticks') as pbar:
        for _ in range(100):
            time.sleep(0.05)
            pbar.update()


if __name__ == '__main__':

    process_files()