How to use the pyprind.prog_class.Prog.__init__ 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 / pyprind / progpercent.py View on Github external
def __init__(self, iterations, track_time=True,
                 stream=2, title='', monitor=False, update_interval=None):
        Prog.__init__(self, iterations, track_time, stream,
                      title, monitor, update_interval)
        self.last_progress = 0
        self._print()
        if monitor:
            try:
                self.process.cpu_percent()
                self.process.memory_percent()
            except AttributeError:  # old version of psutil
                self.process.get_cpu_percent()
                self.process.get_memory_percent()
github rasbt / pyprind / pyprind / progbar.py View on Github external
def __init__(self, iterations, track_time=True, width=30, bar_char='#',
                 stream=2, title='', monitor=False, update_interval=None):
        Prog.__init__(self, iterations, track_time,
                      stream, title, monitor, update_interval)
        self.bar_width = width
        self._adjust_width()
        self.bar_char = bar_char
        self.last_progress = 0

        if monitor:
            try:
                self.process.cpu_percent()
                self.process.memory_percent()
            except AttributeError:  # old version of psutil
                self.process.get_cpu_percent()
                self.process.get_memory_percent()
        if self.item_id:
            self._cache_item_id()