Skip to content

Commit d0464c2

Browse files
committed
Refactoring
1 parent ec4a623 commit d0464c2

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

requests__examples/download_file_with_progressbar/download_in_file__using_tqdm.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,18 @@
77
import os
88
import sys
99

10-
from pathlib import Path
10+
# pip install humanize
11+
from humanize import naturalsize as sizeof_fmt
1112

1213
# pip install tqdm
1314
from tqdm import tqdm
1415

1516
# pip install requests
1617
import requests
1718

18-
sys.path.append(str(Path(__file__).resolve().parent.parent.parent))
19-
from human_byte_size import sizeof_fmt
20-
2119

2220
url = 'https://github.com/gil9red/NotesManager/raw/master/bin.rar'
21+
2322
# Streaming, so we can iterate over the response.
2423
rs = requests.get(url, stream=True)
2524

requests__examples/download_file_with_progressbar/download_in_memory__using_tqdm.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,18 @@
77
import io
88
import sys
99

10-
from pathlib import Path
10+
# pip install humanize
11+
from humanize import naturalsize as sizeof_fmt
1112

1213
# pip install tqdm
1314
from tqdm import tqdm
1415

1516
# pip install requests
1617
import requests
1718

18-
sys.path.append(str(Path(__file__).resolve().parent.parent.parent))
19-
from human_byte_size import sizeof_fmt
20-
2119

2220
url = 'https://github.com/gil9red/NotesManager/raw/master/bin.rar'
21+
2322
# Streaming, so we can iterate over the response.
2423
rs = requests.get(url, stream=True)
2524

0 commit comments

Comments
 (0)