import zipfile import os folder_path = '/content/drive/MyDrive/Target_Folder_Name' zip_path = '/content/drive/MyDrive/Compressed_Folder.zip'

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.

Go to Google Colab and create a new notebook. Step 2: Mount your Google Drive with this code:

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, '..')))

Zip - Google Drive Folder

import zipfile import os folder_path = '/content/drive/MyDrive/Target_Folder_Name' zip_path = '/content/drive/MyDrive/Compressed_Folder.zip'

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

Go to Google Colab and create a new notebook. Step 2: Mount your Google Drive with this code: how do you get that neat

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, '..'))) whether you’re using a browser