File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -196,14 +196,16 @@ def increment(self):
196196 time_per_item = elapsed_time / self ._progress if self ._progress > 0 else 0
197197 eta = (self ._total - self ._progress ) * time_per_item
198198
199- progress_display = f"\r [{ bar } ] { self ._progress } /{ self ._total } "
199+ progress_display = f"[{ bar } ] { self ._progress } /{ self ._total } "
200200 progress_display += f" ({ percentage :.2f} %)"
201201
202202 if self ._progress < self ._total :
203203 progress_display += f" | ETA: { int (eta )} s"
204204 else :
205205 progress_display += " | DONE"
206206
207+ sys .stderr .write ("\r " ) # Move the cursor to the beginning of the line
208+ sys .stderr .write ("\033 [K" ) # Clear the line from the cursor to the end
207209 sys .stderr .write (progress_display )
208210
209211 if self ._progress >= self ._total :
You can’t perform that action at this time.
0 commit comments