This is driving me crazy. a simple python script trying to zip contents of a folder 'X'. My problem is the zip file 'Y.zip' contains the sub files and subfolders of 'X' directly under it without the actual 'X' folder. What i expect is when i open 'Y.Zip' , i should see the folder 'X' and under it all the subfiles. How do i make it ?
def zippy():
folders = os.listdir(os.getcwd())
for each_folder in folders:
if each_folder.endswith('X'):
shutil.make_archive('Y', 'zip' )