![]() Here is how to copy all a directory with its subdirectories and its files, then compress it and encrypt a zip, with password and without needing an associated backup file, here we will see how to authorize a mac address to execute the decryption. If you directly click Extract All option, then it will give error To extract the Generated ZIP file in windows : ![]() Since I am new in python i cant explain the code in detail. Print ("'%s' created successfully." % output_path) Zip_file.write(absolute_path, relative_path)Ībsolute_path = os.path.join(root, file_name) Print ("Adding '%s' to archive." % absolute_path) Relative_path = absolute_path.replace(parent_folder '\\', # Include all subfolders, including empty ones.Ībsolute_path = os.path.join(root, folder_name) Zip_file = pyzipper.AESZipFile('new_test.zip','w',compression=pyzipper.ZIP_DEFLATED,encryption=pyzipper.WZ_AES) # Retrieve the paths of the folder contents. Parent_folder = os.path.dirname(folder_path) Empty subfolders will be included in the archive """Zip the contents of an entire folder (with that folder included ![]() Here is the solution : def zip_folderPyzipper(folder_path, output_path): ![]() I was finally able to accomplish encryping the whole directory(including all subfolder struncture and files) using a library called 'pyzipper' suggested by Anupam Chaplot. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |