A simple Python script to create a zip archive from a specified directory.
QuietDirTozipFile.py
is a Python 3.11 script that compresses the contents of a specified directory into a .zip
archive. It takes two arguments:
source_folder
: The path to the folder you want to compress.zip_file
: The desired output zip file path (with a.zip
suffix).
This script will silently archive the contents of the folder without any prompts or additional outputs, except for a completion message.
- Python 3.10 or higher
- Standard Python libraries:
shutil
,os
,argparse
No installation required. Simply download or clone the repository and run the script using Python 3.11.
-
Open a terminal or command prompt.
-
Navigate to the directory where
QuietDirTozipFile.py
is located. -
Run the script using the following command:
python QuietDirTozipFile.py <source_folder> <zip_file>
<source_folder>
: The directory path you want to compress.<zip_file>
: The path where you want the output.zip
file to be saved (including the.zip
extension).
To compress the folder my_folder
into my_archive.zip
, run:
python QuietDirTozipFile.py my_folder my_archive.zip
Once the process is complete, you will see the following message:
Finish my_folder > my_archive.zip