Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved download() progress bar to STDERR #1776

Merged
merged 3 commits into from
Dec 12, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions yfinance/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import datetime as _datetime
import logging
import re as _re
import sys
ValueRaider marked this conversation as resolved.
Show resolved Hide resolved
import sys as _sys
import threading
from functools import lru_cache
Expand Down Expand Up @@ -858,9 +859,9 @@ def completed(self):
if self.elapsed > self.iterations:
self.elapsed = self.iterations
self.update_iteration(1)
print('\r' + str(self), end='')
_sys.stdout.flush()
print()
print('\r' + str(self), end='', file=sys.stderr)
_sys.stderr.flush()
print("", file=sys.stderr)

def animate(self, iteration=None):
if iteration is None:
Expand All @@ -869,8 +870,8 @@ def animate(self, iteration=None):
else:
self.elapsed += iteration

print('\r' + str(self), end='')
_sys.stdout.flush()
print('\r' + str(self), end='', file=sys.stderr)
_sys.stderr.flush()
self.update_iteration()

def update_iteration(self, val=None):
Expand Down