import os import zipfile import requests # 夏目漱石の「吾輩は猫である」の圧縮ファイルのURL url = "https://www.aozora.gr.jp/cards/000148/files/789_ruby_5639.zip" # ダウンロード先のファイル名 download_file = "wagahaiwa_nekodearu.zip" # ダウンロードして保存 response = requests.get(url) with open(download_file, "wb") as f: f.write(response.content) # ローカルPCの保存先フォルダ output_folder = "D:\\aozora" # 保存先フォルダが存在しない場合、作成 if not os.path.exists(output_fo