Answers for "file could not be opened successfully tarfile zip"

2

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(banking_url, zip_path)
    
    with zipfile.ZipFile(zip_path, 'r') as banking_zip:
        banking_zip.extractall(banking_path)

    banking_zip.close()
    
fetch_bank_data()
Posted by: Guest on June-17-2020

Code answers related to "file could not be opened successfully tarfile zip"

Browse Popular Code Answers by Language