Python is gaining popularity the world over. It is easy to understand why. Unlike other “heavy” languages like C++/Java, Python often allows us to get the job done with fewer lines of code. Its syntax is simple and concise.

In this application example, we write a small Python script simplezip.py to backup a folder and its contents into a compressed zip file. The zip file is stored in the directory C:\backup\{date of backup}. The zip filename is a concatenation of the folder name and time stamp of the backup.

IntegrateDots Inc
A simple Python script to backup a folder and its contents into a compressed zip file.

 

IntegrateDots Inc
Running simplezip.py from command line.

 

IntegrateDots Inc
Backup successful! The zip filename is a concatenation of folder name and time stamp.