kolibrios/_tools/lib/network.py
Magomed Kostoev (mkostoevr) b8453028f7 [WS] Merge download_if_not_exist and download functions
git-svn-id: svn://kolibrios.org@9384 a494cfbc-eb01-0410-851d-a64ba20cac60
2021-12-04 10:41:27 +00:00

12 lines
269 B
Python

import os
import urllib.request
from .logging import log
def download(link, path, skip_exist = False):
if skip_exist and os.path.exists(path):
return
log(f"Downloading {path}... ", end = "")
urllib.request.urlretrieve(link, path)
log("Done.")