Last active
December 28, 2021 16:15
-
-
Save brunomsantiago/6e00fb8ba7e02945e6e37adba0e7fa2b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from zipfile import ZipFile | |
def create_zip_with_fake_files(zip_filepath, fake_file_list): | |
with ZipFile(zip_filepath, 'w') as zip_archive: | |
for relative_filepath in fake_file_list: | |
zip_archive.writestr(relative_filepath, 'a') | |
def main(): | |
fake_files = [ | |
r'file0.txt', | |
r'folder_A\file1.jpg', | |
r'folder_A\file2.mp4', | |
r'folder_B\file3.docx', | |
r'folder_B\file4.csv' | |
] | |
create_zip_with_fake_files('test.zip', fake_files) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment