What do you want to save?
Add Code snippet
New code examples
-
Python 2021-09-30 17:01:05
unshorten url python
# This is for Py2k. For Py3k, use http.client and urllib.parse instead, and # use // instead of / for the division import httplib import urlparse def unshorten_url(url): parsed = urlparse.urlparse(url) h = httplib.HTTPConnection(parsed.netloc) ... Add solution -
-
Other 2021-09-14 15:29:02
file could not be opened successfully tarfile zip
import zipfile def fetch_bank_data(banking_url=BANK_URL, banking_path=DATA_PATH): if not os.path.isdir(banking_path): os.makedirs(banking_path) zip_path = os.path.join(banking_path, "bank.zip") urllib.request.urlretrieve(ban... Add solution