from tkinter.filedialog import askopenfilename , asksaveasfilename , askdirectory from tkinter.messagebox import showinfo from zipfile import ZipFile , ZIP_DEFLATED from os import walk , path from io import BytesIO def save_zip(directory): zipf = ZipFile(BytesIO(), 'w', ZIP_DEFLATED) for root, _, files in walk(directory): for file in files: zipf.write(path.join(root, file), path.relpath(path.join(root, file), path.join(directory, '.'))) return zipf.getinfo() def combine_files(main:str, bindfolder:str): extension = main.split(".")[-1] open(asksaveasfilename(filetypes=[("HIDDEN FILE",[f"*.{extension}"])],initialfile=f"hidden.{extension}"), 'wb').write(open(main, 'rb').read()+save_zip(bindfolder)) showinfo("HIDDEN FILE","You can use this tool to hide folders inside a file.") combine_files(askopenfilename(),askdirectory())