[Python] Python 3 how to zip the contents and folder that are in another folder

Discussão em 'Python' iniciado por Stack, Janeiro 28, 2025.

  1. Stack

    Stack Membro Participativo

    I want to have a folder called 'product_a1' in a folder called 'product_a1' with a text file and process flag files such as 'completed' file. I want to zip the entire thing so it can be put onto a ftp server. The server is currently PHP using 7zip, and expects this structure, but I need to do this using Python code. Its the structure that's important here as ShUtil defaults to single level folder, and so does python 7zip etc.

    /product_a1/product_a1/my_file.txt
    /completed
    /etc

    Continue reading...

Compartilhe esta Página