From 8b92efa5911e67b6ac2261c844387cda965a9fbf Mon Sep 17 00:00:00 2001 From: Sean Booth Date: Mon, 22 Feb 2021 23:15:46 -0600 Subject: [PATCH] Allow progress bar finish without a new line --- progress/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/progress/__init__.py b/progress/__init__.py index be90a43..f48a625 100644 --- a/progress/__init__.py +++ b/progress/__init__.py @@ -101,9 +101,10 @@ def writeln(self, line): print('\r' + line, end='', file=self.file) self.file.flush() - def finish(self): + def finish(self, print_newline=True): if self.file and self.is_tty(): - print(file=self.file) + if print_newline: + print(file=self.file) if self._hidden_cursor: print(SHOW_CURSOR, end='', file=self.file) self._hidden_cursor = False