NiltonVolpato / python-progressbar

Text progress bar library for Python
Other
412 stars 105 forks source link

Support 'with' statement. #71

Open kousu opened 4 years ago

kousu commented 4 years ago

This probably still needs some doc changes before it's worth taking, but I thought I'd throw it out there for you.

Fixes #70.

kousu commented 4 years ago

Also maybe it shouldn't call finish() if there was an exception? .finish() fills in the whole progress bar to the end?

NiltonVolpato commented 3 years ago

Also maybe it shouldn't call finish() if there was an exception? .finish() fills in the whole progress bar to the end?

Yeah, finish ensures that the progress bar reaches 100% and prints a newline. If there's an exception you could just print a newline, so the progress bar would be stuck at whatever percentage the exception happened.