Giter Site home page Giter Site logo

python_progress_bar's People

Contributors

pollev avatar vladimirsinitsin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

python_progress_bar's Issues

Question: Availability on PyPI

Hi there, is the package available on pypi? If so can you please add a link to the README for that.

It looks great btw!

Does not work with logging

The progress bar and logging compete to write on the screen causing something like this:

error_output

It might be difficult to fix this though. Any ideas?

Note: I had modified your code to test with logging. The modified script is:

#!/usr/bin/env python3

import random
import string
import time
import logging

# Import the progress bar
from python_progress_bar import progress_bar
LOGGER = logging.getLogger(__name__)


def random_string(string_length=30):
    letters = string.ascii_lowercase
    return ''.join(random.choice(letters) for i in range(string_length))


def generate_some_output_and_sleep():
    LOGGER.error("Here is some output")
    LOGGER.error(random_string())
    LOGGER.error(random_string())
    LOGGER.error(random_string())
    LOGGER.error(random_string())
    LOGGER.error(
        "\n\n------------------------------------------------------------------"
    )
    LOGGER.error("\n\n Now sleeping briefly")
    time.sleep(0.3)


def main():
    # Make sure that the progress bar is cleaned up when user presses ctrl+c
    progress_bar.enable_trapping()
    # Create progress bar
    progress_bar.setup_scroll_area()
    for i in range(99):
        if i == 50:
            LOGGER.error("waiting for user input: ")
            progress_bar.block_progress_bar(i)
            input("User input: ")
        else:
            generate_some_output_and_sleep()
            progress_bar.draw_progress_bar(i)
    progress_bar.destroy_scroll_area()


main()

Bar shows under edge terminal

The bar is placed under the terminal, only a tiny portion is visible. I'm a Linux Mint Tina 19.2, and had no such issues with the bash version, built-int terminal with zsh (tested without as well)

Even when nothing is printed and we use an empty for loop, the cursor keeps pushing "down" with each iteration.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.