Skip to content

Instantly share code, notes, and snippets.

@daniel-schroeder-dev
Created September 24, 2021 22:52
Show Gist options
  • Save daniel-schroeder-dev/dd85df0fcf5cb1298ca1d919f99ee42e to your computer and use it in GitHub Desktop.
Save daniel-schroeder-dev/dd85df0fcf5cb1298ca1d919f99ee42e to your computer and use it in GitHub Desktop.
CWHQ Zip Folder Script
#!/usr/bin/python3
print("Content-Type: text/html \n")
import cgitb
cgitb.enable()
import shutil
username = "danielj"
zipped_filename = "i_h14_api_lesson_12"
folder_to_zip = "i_h14_api_12"
shutil.make_archive(zipped_filename, "zip", folder_to_zip)
zip_url = f"https://{username}.codewizardshq.com/{zipped_filename}.zip"
print(f"{zipped_filename}.zip created!")
print(f"Download it at <a href={zip_url}>{zip_url}</a>")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment