Skip to content
Merged
Changes from all commits
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
1 change: 1 addition & 0 deletions data_tutorials/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def update_to(self, b=1, bsize=1, tsize=None):

def download_file(url: str, filename: str, dest: Path) -> None:
save_file = dest / filename
url = url if url.endswith('/') else url + '/'
print(f"try to download {filename} from {url} and save it in {save_file}")
with TqdmUpTo(unit = 'B', unit_scale = True, unit_divisor = 1024, miniters = 1, desc = filename) as t:
path, _ = urlretrieve(url + filename, save_file, reporthook = t.update_to)
Expand Down