What do you want to save?
Add Code snippet
New code examples
-
-
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 -
Python 2021-09-12 01:43:03
urllib urlretrieve python 3
try: from urllib.request import Request, urlopen # Python 3 except ImportError: from urllib2 import Request, urlopen # Python 2 req = Request('http://api.company.com/items/details?country=US&language=en') req.add_header('apikey', 'xxx') con... Add solution -
Other 2021-09-10 22:34:02
get unadjusted stock data
from datetime import datetime import json from urllib.parse import urlencode from urllib.request import urlopen def gethistory(symbol, start=None, end=None): # Return 3 tuples (quotes, dividends and splits) with data from start # to end datetimes ... Add solution -
Python 2021-09-07 15:32:01
download pdf from link using python
import urllib.request pdf_path = "" def download_file(download_url, filename): response = urllib.request.urlopen(download_url) file = open(filename + ".pdf", 'wb') file.write(response.read()) file.close() download... Add solution