diff options
| author | Priyansh <[email protected]> | 2021-12-09 03:01:49 -0500 |
|---|---|---|
| committer | Priyansh <[email protected]> | 2021-12-09 03:01:49 -0500 |
| commit | 3b48c04470e2c368ba18716bb789b40942d6989f (patch) | |
| tree | 1cb97d5271f2233fbf9d0ef864b91fc8a61efb17 /initial_setup.py | |
| parent | 22e1d761027501bfa59b92776cf1c13eef3a0004 (diff) | |
| download | temp_pred_arima-3b48c04470e2c368ba18716bb789b40942d6989f.tar.xz temp_pred_arima-3b48c04470e2c368ba18716bb789b40942d6989f.zip | |
changed project structure
Diffstat (limited to 'initial_setup.py')
| -rw-r--r-- | initial_setup.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/initial_setup.py b/initial_setup.py new file mode 100644 index 0000000..0384a70 --- /dev/null +++ b/initial_setup.py @@ -0,0 +1,23 @@ +import sys +import requests + + +def download(url, filename): + with open(filename, 'wb') as f: + response = requests.get(url, stream=True) + total = response.headers.get('content-length') + + if total is None: + f.write(response.content) + else: + downloaded = 0 + total = int(total) + for data in response.iter_content(chunk_size=max(int(total/1000), 1024*1024)): + downloaded += len(data) + f.write(data) + done = int(50*downloaded/total) + sys.stdout.write('\r[{}{}]'.format('█' * done, '.' * (50-done))) + sys.stdout.flush() + sys.stdout.write('\n') + +print('[*] Downloading test file of size 100 MB...')
\ No newline at end of file |
