File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed
requests__examples/download_file_with_progressbar Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change 7
7
import os
8
8
import sys
9
9
10
- from pathlib import Path
10
+ # pip install humanize
11
+ from humanize import naturalsize as sizeof_fmt
11
12
12
13
# pip install tqdm
13
14
from tqdm import tqdm
14
15
15
16
# pip install requests
16
17
import requests
17
18
18
- sys .path .append (str (Path (__file__ ).resolve ().parent .parent .parent ))
19
- from human_byte_size import sizeof_fmt
20
-
21
19
22
20
url = 'https://github.com/gil9red/NotesManager/raw/master/bin.rar'
21
+
23
22
# Streaming, so we can iterate over the response.
24
23
rs = requests .get (url , stream = True )
25
24
Original file line number Diff line number Diff line change 7
7
import io
8
8
import sys
9
9
10
- from pathlib import Path
10
+ # pip install humanize
11
+ from humanize import naturalsize as sizeof_fmt
11
12
12
13
# pip install tqdm
13
14
from tqdm import tqdm
14
15
15
16
# pip install requests
16
17
import requests
17
18
18
- sys .path .append (str (Path (__file__ ).resolve ().parent .parent .parent ))
19
- from human_byte_size import sizeof_fmt
20
-
21
19
22
20
url = 'https://github.com/gil9red/NotesManager/raw/master/bin.rar'
21
+
23
22
# Streaming, so we can iterate over the response.
24
23
rs = requests .get (url , stream = True )
25
24
You can’t perform that action at this time.
0 commit comments