Drive Folder __full__ - Zip Google
with zipfile.ZipFile(zip_path, 'w', zipfile.ZIP_DEFLATED) as zipf: for root, dirs, files in os.walk(folder_path): for file in files: zipf.write(os.path.join(root, file), arcname=os.path.relpath(os.path.join(root, file), os.path.join(folder_path, '..')))
So, how do you get that neat, compressed .zip archive? You need a workaround. Here are the three fastest methods to zip a Google Drive folder, whether you’re using a browser, a PC, or a mobile device. This is the most reliable method if you don't want to install extra software. zip google drive folder
from google.colab import drive drive.mount('/content/drive') Run the following script to zip a specific folder: with zipfile
Go to Google Colab and create a new notebook. Step 2: Mount your Google Drive with this code: zipfile.ZIP_DEFLATED) as zipf: for root