Peace
Hi everyone
when I create a zip file, it takes all the folders and adds them to the zip file
"user/files/programs/day44/img.png"
what I want is to store only the last folder
"day44/img.png"
img1.png,img2.png ...
values['-SOURCEFOLDER-'] is the folder path C:user/files/programs/day44
Hi everyone
when I create a zip file, it takes all the folders and adds them to the zip file
"user/files/programs/day44/img.png"
what I want is to store only the last folder
"day44/img.png"
with zipfile.ZipFile(f"{file_name}.zip", 'w') as f: for image_name in images_name_list: file = os.path.join(values['-SOURCEFOLDER-'],image_name) f.write(file)in the images_name_list variable we have a list of image names and types:
img1.png,img2.png ...
values['-SOURCEFOLDER-'] is the folder path C:user/files/programs/day44